Skip to content

Commit

Permalink
Use AD::Reloader.to_cleanup for reloading [rails#2873 state:resolved]
Browse files Browse the repository at this point in the history
  • Loading branch information
John Firebaugh committed Dec 20, 2010
1 parent b39f753 commit 3b90dc0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 3 additions & 5 deletions activerecord/lib/active_record/railtie.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -69,11 +69,9 @@ class Railtie < Rails::Railtie
end end


initializer "active_record.set_dispatch_hooks", :before => :set_clear_dependencies_hook do |app| initializer "active_record.set_dispatch_hooks", :before => :set_clear_dependencies_hook do |app|
unless app.config.cache_classes ActiveSupport.on_load(:active_record) do
ActiveSupport.on_load(:active_record) do ActionDispatch::Reloader.to_cleanup do
ActionDispatch::Callbacks.after do ActiveRecord::Base.clear_reloadable_connections!
ActiveRecord::Base.clear_reloadable_connections!
end
end end
end end
end end
Expand Down
8 changes: 3 additions & 5 deletions railties/lib/rails/application/bootstrap.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -51,11 +51,9 @@ module Bootstrap
end end


initializer :set_clear_dependencies_hook do initializer :set_clear_dependencies_hook do
unless config.cache_classes ActionDispatch::Reloader.to_cleanup do
ActionDispatch::Callbacks.after do ActiveSupport::DescendantsTracker.clear
ActiveSupport::DescendantsTracker.clear ActiveSupport::Dependencies.clear
ActiveSupport::Dependencies.clear
end
end end
end end


Expand Down

0 comments on commit 3b90dc0

Please sign in to comment.