未验证 提交 e95edb3d 编写于 作者: E Eileen M. Uchitelle 提交者: GitHub

Merge pull request #39536 from eileencodes/remove-assumption-that-primary-exists

Remove assumption that a primary config exists
......@@ -563,7 +563,7 @@ db_namespace = namespace :db do
end
ensure
if should_reconnect
ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations.configs_for(env_name: ActiveRecord::Tasks::DatabaseTasks.env, name: "primary"))
ActiveRecord::Base.establish_connection(ActiveRecord::Tasks::DatabaseTasks.env.to_sym)
end
end
......
......@@ -95,7 +95,7 @@ def to_html
# The name of the database adapter for the current environment.
property "Database adapter" do
ActiveRecord::Base.configurations.configs_for(env_name: Rails.env, name: "primary").adapter
ActiveRecord::Base.connection.pool.db_config.adapter
end
property "Database schema version" do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册