提交 85cc7122 编写于 作者: A Aaron Patterson

only clear caches if we are actually connected to the database

上级 5287d367
......@@ -149,11 +149,13 @@ class Railtie < Rails::Railtie # :nodoc:
ActiveSupport.on_load(:active_record) do
ActionDispatch::Reloader.send(hook) do
if ActiveRecord::Base.connected?
ActiveRecord::Base.clear_reloadable_connections!
ActiveRecord::Base.clear_cache!
end
end
end
end
initializer "active_record.add_watchable_files" do |app|
path = app.paths["db"].first
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册