1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/railties/lib/rails
eileencodes 37d1429ab1 Load YAML for rake tasks without parsing ERB
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
2019-03-06 08:59:27 -05:00
..
api Generate Action Text's API docs 2019-01-04 23:56:22 -05:00
application Load YAML for rake tasks without parsing ERB 2019-03-06 08:59:27 -05:00
command Optimized namespaces_to_paths method. 2019-02-11 23:25:11 +05:30
commands Fix typo: overriden -> overridden [ci skip] (#35060) 2019-01-26 15:43:30 +05:30
console
engine Remove asset paths from eager_load_paths and autoload_paths 2018-11-09 14:48:15 -05:00
generators Correctly escape ERB tag 2019-03-04 08:17:16 +09:00
plugin [Railties] require_relative => require 2017-10-21 22:48:26 +09:00
rack Log the remote IP addr of clients behind a proxy 2018-07-31 20:45:37 +05:30
railtie Clarify that config.eager_load controls eager loading [ci skip] 2017-12-30 22:37:44 +00:00
tasks Add Channel tests to rails stats 2019-01-21 10:45:08 +00:00
templates Ruby can show a little bit more detailed info in shorter code 2018-12-15 13:21:58 +09:00
test_unit Add rails test:channels. 2019-01-16 16:34:34 +00:00
all.rb Import Action Text 2019-01-04 22:22:49 -05:00
app_loader.rb Railities typo fixes. 2019-02-01 16:42:40 +05:30
app_updater.rb Remove --skip-yarn in favor of --skip-javascript 2018-10-22 16:54:10 +03:00
application.rb Fix the config_for to always return a NonSymbolAccessDeprecatedHash: 2019-02-14 14:11:05 +01:00
application_controller.rb Always yield a CSP policy instance 2018-03-08 14:14:09 +00:00
autoloaders.rb simplifies Rails.autoloaders.logger= 2019-02-21 14:51:28 -08:00
backtrace_cleaner.rb Add Style/RedundantFreeze to remove redudant .freeze 2018-09-29 07:18:44 +00:00
cli.rb [Railties] require_relative => require 2017-10-21 22:48:26 +09:00
code_statistics.rb Enable Lint/UselessAssignment cop to avoid unused variable warnings (#34904) 2019-01-09 18:09:01 +09:00
code_statistics_calculator.rb
command.rb Homogenize rails help output 2018-11-19 22:48:51 +01:00
commands.rb [Railties] require_relative => require 2017-10-21 22:48:26 +09:00
configuration.rb Turn on performance based cops 2018-07-23 15:37:06 -07:00
dev_caching.rb
engine.rb Replace autoloader accessors with Rails.autoloaders.{main,once} 2019-02-14 22:34:16 -08:00
gem_version.rb Preparing for 6.0.0.beta2 release 2019-02-25 17:45:04 -05:00
generators.rb Add rails db:system:change command 2019-01-09 14:23:25 -05:00
info.rb Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json" 2019-01-08 22:21:20 +01:00
info_controller.rb Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json" 2019-01-08 22:21:20 +01:00
initializable.rb
mailers_controller.rb Introduce a guard against DNS rebinding attacks 2018-12-15 20:18:51 +02:00
paths.rb Remove asset paths from eager_load_paths and autoload_paths 2018-11-09 14:48:15 -05:00
rack.rb
railtie.rb Fix call sites 2018-10-02 15:31:29 -04:00
ruby_version_check.rb Require Ruby 2.5 for Rails 6. 2018-12-19 21:47:50 +01:00
secrets.rb Remove usage of strip_heredoc in the framework in favor of <<~ 2018-02-16 19:28:30 -05:00
source_annotation_extractor.rb Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
tasks.rb Make rake routes deprecate before deleting 2018-08-20 08:47:29 +09:00
test_help.rb Use testing lazy-load hooks: 2018-07-04 16:34:59 -04:00
version.rb
welcome_controller.rb [Railties] require_relative => require 2017-10-21 22:48:26 +09:00