diff options
-rw-r--r-- | guides/source/configuring.md | 2 | ||||
-rw-r--r-- | railties/lib/rails/application/finisher.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/guides/source/configuring.md b/guides/source/configuring.md index b3d3b2c681..8d22cf4504 100644 --- a/guides/source/configuring.md +++ b/guides/source/configuring.md @@ -94,6 +94,8 @@ application. Accepts a valid week day symbol (e.g. `:monday`). * `config.eager_load_paths` accepts an array of paths from which Rails will eager load on boot if cache classes is enabled. Defaults to every folder in the `app` directory of the application. +* `config.enable_dependency_loading` when true, enable the autoload loading behavior even if the application is eager loaded and have `cache_classes` as true. Default to false. + * `config.encoding` sets up the application-wide encoding. Defaults to UTF-8. * `config.exceptions_app` sets the exceptions application invoked by the ShowException middleware when an exception happens. Defaults to `ActionDispatch::PublicExceptions.new(Rails.public_path)`. diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index 97dde9a3e9..daf3a24b16 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -176,7 +176,7 @@ module Rails # Disable dependency loading during request cycle initializer :disable_dependency_loading do - if config.eager_load && config.cache_classes + if config.eager_load && config.cache_classes && !config.enable_dependency_loading ActiveSupport::Dependencies.unhook! end end |