Skip to content

Commit

Permalink
Use class_inheritable_accessor for connection_handler
Browse files Browse the repository at this point in the history
  • Loading branch information
lifo committed May 4, 2010
1 parent 0d767fd commit 04fa5af
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 04fa5af

Please sign in to comment.