diff options
| -rw-r--r-- | activerecord/lib/active_record/connection_handling.rb | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_handling.rb b/activerecord/lib/active_record/connection_handling.rb index 0a69ad2c0e..74bbf6fc36 100644 --- a/activerecord/lib/active_record/connection_handling.rb +++ b/activerecord/lib/active_record/connection_handling.rb @@ -51,13 +51,13 @@ module ActiveRecord        resolver =   ConnectionAdapters::ConnectionSpecification::Resolver.new configurations        # TODO: uses name on establish_connection, for backwards compatibility        spec     =   resolver.spec(spec, self == Base ? "primary" : name) -      self.connection_specification_name = spec.name        unless respond_to?(spec.adapter_method)          raise AdapterNotFound, "database configuration specifies nonexistent #{spec.config[:adapter]} adapter"        end -      remove_connection +      remove_connection(spec.name) +      self.connection_specification_name = spec.name        connection_handler.establish_connection spec      end  | 
