diff options
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/connection_specification.rb | 6 | ||||
-rw-r--r-- | activerecord/lib/active_record/railtie.rb | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/connection_specification.rb b/activerecord/lib/active_record/connection_adapters/connection_specification.rb index a87eed5243..5f50ca6aae 100644 --- a/activerecord/lib/active_record/connection_adapters/connection_specification.rb +++ b/activerecord/lib/active_record/connection_adapters/connection_specification.rb @@ -48,11 +48,11 @@ module ActiveRecord # an environment key or a url spec. So we support both for # now but it would be nice to limit the environment key only # for symbols. - spec = configurations.fetch(spec.to_s) do + config = configurations.fetch(spec.to_s) do resolve_string_connection(spec) if spec.is_a?(String) end - raise(AdapterNotSpecified, "#{spec} database is not configured") unless spec - resolve_connection spec + raise(AdapterNotSpecified, "#{spec} database is not configured") unless config + resolve_connection config end def resolve_hash_connection(spec) # :nodoc: diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index 2c796f97e6..19e27ccb37 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -56,7 +56,7 @@ module ActiveRecord resolver = ActiveRecord::ConnectionAdapters::ConnectionSpecification::Resolver.new(configuration) configuration.each do |key, value| - configuration[key] = resolver.resolve(value) if value + configuration[key] = resolver.resolve(value).config.stringify_keys if value end ActiveRecord::Tasks::DatabaseTasks.database_configuration = configuration |