aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorArthur Neves <arthurnn@gmail.com>2016-05-06 13:22:49 -0500
committerArthur Neves <arthurnn@gmail.com>2016-05-06 13:22:49 -0500
commit22a127c57baa533498124e1650d00fb780618ed2 (patch)
treecfd32b870f122a015c6817fc28f35ae73d486470 /activerecord
parent598e7c9e2004b85146386571372423020ba7c52a (diff)
downloadrails-22a127c57baa533498124e1650d00fb780618ed2.tar.gz
rails-22a127c57baa533498124e1650d00fb780618ed2.tar.bz2
rails-22a127c57baa533498124e1650d00fb780618ed2.zip
s/specification_name/connection_specification_name
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_handling.rb20
-rw-r--r--activerecord/lib/active_record/core.rb2
-rw-r--r--activerecord/lib/active_record/tasks/database_tasks.rb2
-rw-r--r--activerecord/test/cases/multiple_db_test.rb4
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