Skip to content

Commit

Permalink
Revert "Don't unhook autoloading in production"
Browse files Browse the repository at this point in the history
This reverts commit a8bf129.
  • Loading branch information
tenderlove committed Feb 16, 2015
1 parent 05b6e5d commit a71350c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions railties/lib/rails/application/finisher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

6 comments on commit a71350c

@pixeltrix
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@rafaelfranca
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zdennis no. This i a huge change.

@prathamesh-sonpatki
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@rafaelfranca
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@TylerRick
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a link back to #13142 (comment) where this commit was discussed

Please sign in to comment.