1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

only clear caches if we are actually connected to the database

This commit is contained in:
Aaron Patterson 2012-11-12 17:24:10 -08:00
parent 5287d3678d
commit 85cc7122ba

View file

@ -149,8 +149,10 @@ module ActiveRecord
ActiveSupport.on_load(:active_record) do
ActionDispatch::Reloader.send(hook) do
ActiveRecord::Base.clear_reloadable_connections!
ActiveRecord::Base.clear_cache!
if ActiveRecord::Base.connected?
ActiveRecord::Base.clear_reloadable_connections!
ActiveRecord::Base.clear_cache!
end
end
end
end