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:
parent
5287d3678d
commit
85cc7122ba
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue