aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application/dummy_erb_compiler.rb
Commit message (Collapse)AuthorAgeFilesLines
* Fix: DummyCompiler embeds invalid YAML contentVishal Telangre2019-05-151-8/+2
| | | | | | Fixes https://github.com/rails/rails/issues/36285. Follow up of https://github.com/rails/rails/pull/36237.
* Fix database loading when ERB is single line ternaryeileencodes2019-05-101-1/+6
| | | | | | | | | | | | *sigh* this seems like the never ending bug. I don't love or even like this fix but it does _work_. Rafael suggested using `dummy_key: dummy_value` but unfortunately that doesn't work. So we're left with checking whethere there might be ternary type things in the content and then assuming that we want to replace the line with a key value pair. Technically fixes https://github.com/rails/rails/issues/36088
* Fix rubocop violationsyuuji.yaginuma2019-03-131-1/+1
|
* Do not generate dummy string when the tag used is not the <%=Rafael Mendonça França2019-03-111-1/+4
|
* Load YAML for rake tasks without parsing ERBeileencodes2019-03-061-0/+16
This change adds a new method that loads the YAML for the database config without parsing the ERB. This may seem odd but bear with me: When we added the ability to have rake tasks for multiple databases we started looping through the configurations to collect the namespaces so we could do `rake db:create:my_second_db`. See #32274. This caused a problem where if you had `Rails.config.max_threads` set in your database.yml it will blow up because the environment that defines `max_threads` isn't loaded during `rake -T`. See #35468. We tried to fix this by adding the ability to just load the YAML and ignore ERB all together but that caused a bug in GitHub's YAML loading where if you used multi-line ERB the YAML was invalid. That led us to reverting some changes in #33748. After trying to resolve this a bunch of ways `@tenderlove` came up with replacing the ERB values so that we don't need to load the environment but we also can load the YAML. This change adds a DummyCompiler for ERB that will replace all the values so we can load the database yaml and create the rake tasks. Nothing else uses this method so it's "safe". DO NOT use this method in your application. Fixes #35468