aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2013-02-19 07:28:11 +0000
committerAndrew White <andyw@pixeltrix.co.uk>2013-02-19 07:28:11 +0000
commita8bf12979e5fa15282b39c8cfa315e663f613539 (patch)
tree92069a25203e5614291d3fa1a41a5a31a5d1701d /railties
parent9d9b22f47a1928bf2fde3b7b574e3d8d4b1cca92 (diff)
downloadrails-a8bf12979e5fa15282b39c8cfa315e663f613539.tar.gz
rails-a8bf12979e5fa15282b39c8cfa315e663f613539.tar.bz2
rails-a8bf12979e5fa15282b39c8cfa315e663f613539.zip
Don't unhook autoloading in production
Whilst autoloading is known to be not threadsafe, leaving it in place is a softer solution than failing hard when an application is deployed. Many older applications will have paths added to `autoload_paths` and ideally these should be eagerly loaded to be threadsafe. However one of these paths is quite often lib which could lead to unintended consequences due to the 'junk drawer' nature of this directory. Developers should refrain from adding paths to `autoload_paths` or `eager_load_paths` and use custom folders inside app for code that needs to be eagerly loaded and use `require` or `require_dependency` to explicitly load code from other locations.
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/application/finisher.rb7
1 files changed, 0 insertions, 7 deletions
diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb
index 872d78d9a4..3ae60312c5 100644
--- a/railties/lib/rails/application/finisher.rb
+++ b/railties/lib/rails/application/finisher.rb
@@ -89,13 +89,6 @@ module Rails
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