diff options
author | Xavier Noria <fxn@hashref.com> | 2016-06-30 17:50:31 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2016-06-30 17:50:37 +0200 |
commit | b036b7a8106e4362f909401cc5a26c92887d2852 (patch) | |
tree | 6d02a1215a19e5ea53f28dd5025451cc58dfd6b7 /guides | |
parent | 21f72a4d3411578e58908ba67a9f20cdb9a103e3 (diff) | |
download | rails-b036b7a8106e4362f909401cc5a26c92887d2852.tar.gz rails-b036b7a8106e4362f909401cc5a26c92887d2852.tar.bz2 rails-b036b7a8106e4362f909401cc5a26c92887d2852.zip |
expands a bit a section of the upgrade guide [ci skip]
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/upgrading_ruby_on_rails.md | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index b7fbf9963b..96566087b5 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -145,11 +145,22 @@ your Gemfile. If you are using Rspec for testing please see the extra configuration required in the gem's documentation. -### Autoloading is disabled in production environment +### Autoloading is disabled after booting in the production environment -Autoloading of classes is now disabled in production environment by default. If your code -is dependent on autoloading in production, then you can opt out by setting -`Rails.application.config.enable_dependency_loading` to true. +Autoloading is now disabled after booting in the production environment by +default. + +Eager loading the application is part of the boot process, so top-level +constants are fine and are still autoloaded, no need to require their files. + +Constants in deeper places only executed at runtime like regular method bodies +are also fine anyway, the are known by then because the file defining them +will have been eager loaded while booting. + +For the vast majority of applications this change needs no action. But in the +very rare event that your application needs autoloading while running in +production mode, set `Rails.application.config.enable_dependency_loading` to +false. ### XML Serialization |