Skip to content
Browse files

Use class_inheritable_accessor for connection_handler

  • Loading branch information...
1 parent 0d767fd commit 04fa5af6a65d1d0e03d3c57d03a2fc8abd11909a @lifo lifo committed May 4, 2010
View
6 activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb
@@ -10,8 +10,8 @@ def initialize (config, adapter_method)
##
# :singleton-method:
# The connection handler
- cattr_accessor :connection_handler, :instance_writer => false
- @@connection_handler = ConnectionAdapters::ConnectionHandler.new
+ class_inheritable_accessor :connection_handler, :instance_writer => false
+ self.connection_handler = ConnectionAdapters::ConnectionHandler.new
# Returns the connection currently associated with the class. This can
# also be used to "borrow" the connection to do database work that isn't
@@ -54,7 +54,7 @@ def self.establish_connection(spec = nil)
raise AdapterNotSpecified unless defined? RAILS_ENV
establish_connection(RAILS_ENV)
when ConnectionSpecification
- @@connection_handler.establish_connection(name, spec)
+ self.connection_handler.establish_connection(name, spec)
when Symbol, String
if configuration = configurations[spec.to_s]
establish_connection(configuration)

0 comments on commit 04fa5af

Please sign in to comment.
Something went wrong with that request. Please try again.