From e683ab7c390f26e110387822c7ffb5ac6aafebca Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Sun, 19 Dec 2010 16:00:01 -0800 Subject: Use AD::Reloader.to_cleanup for reloading [#2873 state:resolved] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Valim --- activerecord/lib/active_record/railtie.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index ba455ea79d..61fb0ae468 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -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 -- cgit v1.2.3