mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Switch dbconsole config loader check
In a three-tier config environment `configurations[environment].presence` will return `{ :primary => { :key => value, :key => value }, :secondary => { :key => value, :key => value} }, which means it's not given a single config to connect to. If we flip these however it will connect to primary because that's the default connection, and on a two tier it will be `nil` so the code will select the connection from the configurations rather than the connection.
This commit is contained in:
parent
0392946319
commit
4027643f7f
1 changed files with 1 additions and 1 deletions
|
@ -97,7 +97,7 @@ module Rails
|
|||
elsif configurations[environment].blank? && configurations[connection].blank?
|
||||
raise ActiveRecord::AdapterNotSpecified, "'#{environment}' database is not configured. Available configuration: #{configurations.inspect}"
|
||||
else
|
||||
configurations[environment].presence || configurations[connection]
|
||||
configurations[connection] || configurations[environment].presence
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue