Permalink
Browse files

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

  • Loading branch information...
John Firebaugh
John Firebaugh committed Dec 20, 2010
1 parent b39f753 commit 3b90dc0b80923c9fb09102ceccab448a8c30c23c
Showing with 6 additions and 10 deletions.
  1. +3 −5 activerecord/lib/active_record/railtie.rb
  2. +3 −5 railties/lib/rails/application/bootstrap.rb
@@ -69,11 +69,9 @@ class Railtie < Rails::Railtie
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 Bootstrap
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

0 comments on commit 3b90dc0

Please sign in to comment.