diff options
author | Arthur Neves <arthurnn@gmail.com> | 2016-05-05 15:25:08 -0500 |
---|---|---|
committer | Arthur Neves <arthurnn@gmail.com> | 2016-05-05 15:39:27 -0500 |
commit | 598e7c9e2004b85146386571372423020ba7c52a (patch) | |
tree | d9749f43554c60008fe0fb3888c332356d0ef781 /activerecord/lib/active_record/connection_handling.rb | |
parent | 34856ba9fa893bd1483ca5b08b65562cd5c02c58 (diff) | |
download | rails-598e7c9e2004b85146386571372423020ba7c52a.tar.gz rails-598e7c9e2004b85146386571372423020ba7c52a.tar.bz2 rails-598e7c9e2004b85146386571372423020ba7c52a.zip |
s/specification_id/specification_name
Diffstat (limited to 'activerecord/lib/active_record/connection_handling.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_handling.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/activerecord/lib/active_record/connection_handling.rb b/activerecord/lib/active_record/connection_handling.rb index 7d01c4ea48..f363a2d21b 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_id = spec.id + self.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_id + attr_writer :specification_name # Return the specification id from this class otherwise look it up # in the parent. - def specification_id - unless defined?(@specification_id) - @specification_id = self == Base ? "primary" : superclass.specification_id + def specification_name + unless defined?(@specification_name) + @specification_name = self == Base ? "primary" : superclass.specification_name end - @specification_id + @specification_name end def connection_id @@ -121,20 +121,20 @@ module ActiveRecord end def connection_pool - connection_handler.retrieve_connection_pool(specification_id) or raise ConnectionNotEstablished + connection_handler.retrieve_connection_pool(specification_name) or raise ConnectionNotEstablished end def retrieve_connection - connection_handler.retrieve_connection(specification_id) + connection_handler.retrieve_connection(specification_name) end # Returns +true+ if Active Record is connected. def connected? - connection_handler.connected?(specification_id) + connection_handler.connected?(specification_name) end - def remove_connection(id = specification_id) - connection_handler.remove_connection(id) + def remove_connection(name = specification_name) + connection_handler.remove_connection(name) end def clear_cache! # :nodoc: |