Use AD::Reloader.to_cleanup for reloading [#2873 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
John Firebaugh
2010-12-19 16:00:01 -08:00
committed by José Valim
parent 435bccda93
commit e683ab7c39
2 changed files with 6 additions and 10 deletions

View File

@@ -69,11 +69,9 @@ module ActiveRecord
end
initializer "active_record.set_dispatch_hooks", :before => :set_clear_dependencies_hook do |app|
unless app.config.cache_classes
ActiveSupport.on_load(:active_record) do
ActionDispatch::Callbacks.after do
ActiveRecord::Base.clear_reloadable_connections!
end
ActiveSupport.on_load(:active_record) do
ActionDispatch::Reloader.to_cleanup do
ActiveRecord::Base.clear_reloadable_connections!
end
end
end

View File

@@ -51,11 +51,9 @@ module Rails
end
initializer :set_clear_dependencies_hook do
unless config.cache_classes
ActionDispatch::Callbacks.after do
ActiveSupport::DescendantsTracker.clear
ActiveSupport::Dependencies.clear
end
ActionDispatch::Reloader.to_cleanup do
ActiveSupport::DescendantsTracker.clear
ActiveSupport::Dependencies.clear
end
end