Merge pull request #38670 from eileencodes/remove-unnecessary-lines

Remove unnecessary creation of new hash config
This commit is contained in:
Eileen M. Uchitelle 2020-03-06 17:35:32 -05:00 committed by GitHub
commit 526dd6472b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 7 deletions

View File

@ -184,17 +184,13 @@ module ActiveRecord
end
end
def resolve_symbol_connection(env_name, pool_name)
db_config = find_db_config(env_name)
if db_config
config = db_config.configuration_hash.dup
db_config = DatabaseConfigurations::HashConfig.new(db_config.env_name, db_config.name, config)
def resolve_symbol_connection(name, pool_name)
if db_config = find_db_config(name)
db_config.owner_name = pool_name.to_s
db_config
else
raise AdapterNotSpecified, <<~MSG
The `#{env_name}` database is not configured for the `#{default_env}` environment.
The `#{name}` database is not configured for the `#{default_env}` environment.
Available databases configurations are: