diff options
-rw-r--r-- | activerecord/lib/active_record/connection_handling.rb | 20 | ||||
-rw-r--r-- | activerecord/lib/active_record/core.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/tasks/database_tasks.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/multiple_db_test.rb | 4 |
4 files changed, 14 insertions, 14 deletions
diff --git a/activerecord/lib/active_record/connection_handling.rb b/activerecord/lib/active_record/connection_handling.rb index f363a2d21b..ba763149cc 100644 --- a/activerecord/lib/active_record/connection_handling.rb +++ b/activerecord/lib/active_record/connection_handling.rb @@ -51,7 +51,7 @@ 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.specification_name = spec.name + self.connection_specification_name = spec.name unless respond_to?(spec.adapter_method) raise AdapterNotFound, "database configuration specifies nonexistent #{spec.config[:adapter]} adapter" @@ -91,15 +91,15 @@ module ActiveRecord retrieve_connection end - attr_writer :specification_name + attr_writer :connection_specification_name # Return the specification id from this class otherwise look it up # in the parent. - def specification_name - unless defined?(@specification_name) - @specification_name = self == Base ? "primary" : superclass.specification_name + def connection_specification_name + unless defined?(@connection_specification_name) + @connection_specification_name = self == Base ? "primary" : superclass.connection_specification_name end - @specification_name + @connection_specification_name end def connection_id @@ -121,19 +121,19 @@ module ActiveRecord end def connection_pool - connection_handler.retrieve_connection_pool(specification_name) or raise ConnectionNotEstablished + connection_handler.retrieve_connection_pool(connection_specification_name) or raise ConnectionNotEstablished end def retrieve_connection - connection_handler.retrieve_connection(specification_name) + connection_handler.retrieve_connection(connection_specification_name) end # Returns +true+ if Active Record is connected. def connected? - connection_handler.connected?(specification_name) + connection_handler.connected?(connection_specification_name) end - def remove_connection(name = specification_name) + def remove_connection(name = connection_specification_name) connection_handler.remove_connection(name) end diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index 4abe25e5b7..f936e865e4 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -257,7 +257,7 @@ module ActiveRecord # Returns the Arel engine. def arel_engine # :nodoc: @arel_engine ||= - if Base == self || connection_handler.retrieve_connection_pool(specification_name) + if Base == self || connection_handler.retrieve_connection_pool(connection_specification_name) self else superclass.arel_engine diff --git a/activerecord/lib/active_record/tasks/database_tasks.rb b/activerecord/lib/active_record/tasks/database_tasks.rb index 4fbc93496a..0df46d54df 100644 --- a/activerecord/lib/active_record/tasks/database_tasks.rb +++ b/activerecord/lib/active_record/tasks/database_tasks.rb @@ -117,7 +117,7 @@ module ActiveRecord end def create_all - old_pool = ActiveRecord::Base.connection_handler.retrieve_connection_pool(ActiveRecord::Base.specification_name) + old_pool = ActiveRecord::Base.connection_handler.retrieve_connection_pool(ActiveRecord::Base.connection_specification_name) each_local_configuration { |configuration| create configuration } if old_pool ActiveRecord::Base.connection_handler.establish_connection(old_pool.spec) diff --git a/activerecord/test/cases/multiple_db_test.rb b/activerecord/test/cases/multiple_db_test.rb index 2838315bca..a4fbf579a1 100644 --- a/activerecord/test/cases/multiple_db_test.rb +++ b/activerecord/test/cases/multiple_db_test.rb @@ -25,10 +25,10 @@ class MultipleDbTest < ActiveRecord::TestCase end def test_swapping_the_connection - old_spec_name, Course.specification_name = Course.specification_name, "primary" + old_spec_name, Course.connection_specification_name = Course.connection_specification_name, "primary" assert_equal(Entrant.connection, Course.connection) ensure - Course.specification_name = old_spec_name + Course.connection_specification_name = old_spec_name end def test_find |