Permalink
Browse files

Revert "Don't unhook autoloading in production"

This reverts commit a8bf129.
  • Loading branch information...
1 parent 05b6e5d commit a71350cae0082193ad8c66d65ab62e8bb0b7853b @tenderlove tenderlove committed Feb 16, 2015
Showing with 7 additions and 0 deletions.
  1. +7 −0 railties/lib/rails/application/finisher.rb
@@ -108,6 +108,13 @@ module Finisher
ActionDispatch::Reloader.to_cleanup(&callback)
end
end
+
+ # Disable dependency loading during request cycle
+ initializer :disable_dependency_loading do
+ if config.eager_load && config.cache_classes
+ ActiveSupport::Dependencies.unhook!
+ end
+ end
end
end
end

5 comments on commit a71350c

@pixeltrix
Member

Didn't spot that a8bf129 got reverted. @jeremy ISTR that you needed this for some of your apps - is that still the case or are we only talking about legacy apps that won't be upgraded to Rails 5?

@zdennis
Contributor

@tenderlove, TY for reverting this. Any chance this will be backported to the 4.x series?

@rafaelfranca
Member

@zdennis no. This i a huge change.

@prathamesh-sonpatki

@rafaelfranca Anything needs to be mentioned in upgrade guides and release notes about this commit?

@rafaelfranca
Member

Yes. It needs to mention that if folder in the autoload_paths but not in the eager_load_paths are not going to be loaded in production.

Please sign in to comment.