From b036b7a8106e4362f909401cc5a26c92887d2852 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Thu, 30 Jun 2016 17:50:31 +0200 Subject: expands a bit a section of the upgrade guide [ci skip] --- guides/source/upgrading_ruby_on_rails.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'guides/source') 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 -- cgit v1.2.3