Add option to enable dependency loading in production
This will make easier to applications that rely on having const_missing
hooks in production upgrade to Rails 5.
This option is going to be remove in the future and the default behavior
will be to disable the dependency loading.
Loading branch information
2 changed files
and 1 deletion.
@@ -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)`.
@@ -176,7 +176,7 @@ def self.complete(_state)
# Disable dependency loading during request cycle
if config.eager_load && config.cache_classes
if config.eager_load && config.cache_classes && ! config.enable_dependency_loading