mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Use AD::Reloader.to_cleanup for reloading [#2873 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
committed by
José Valim
parent
435bccda93
commit
e683ab7c39
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user