diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-12-05 21:48:23 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-12-05 21:48:23 +0000 |
commit | 3ed6675c68f5c0531024d160a5bbe2c706b383cc (patch) | |
tree | edc07f74c0afafbda2f9a3059247c23c650727f5 /activerecord/lib/active_record/base.rb | |
parent | b13573ed3796508f224f0b86f13462272c212fe3 (diff) | |
download | rails-3ed6675c68f5c0531024d160a5bbe2c706b383cc.tar.gz rails-3ed6675c68f5c0531024d160a5bbe2c706b383cc.tar.bz2 rails-3ed6675c68f5c0531024d160a5bbe2c706b383cc.zip |
Clear the connection cache entry when a new connection is established on the same class.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3222 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index d8cdf225d6..27b2de6f8d 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -243,26 +243,6 @@ module ActiveRecord #:nodoc: # on to any new database connections made and which can be retrieved on both a class and instance level by calling +logger+. cattr_accessor :logger - @@connection_cache = Hash.new { |h, k| h[k] = Hash.new } - - # Returns the connection currently associated with the class. This can - # also be used to "borrow" the connection to do database work unrelated - # to any of the specific Active Records. - def self.connection - @@connection_cache[Thread.current.object_id][name] ||= retrieve_connection - end - - def self.clear_connection_cache! - @@connection_cache.clear - end - - # Returns the connection currently associated with the class. This can - # also be used to "borrow" the connection to do database work that isn't - # easily done without going straight to SQL. - def connection - self.class.connection - end - def self.inherited(child) #:nodoc: @@subclasses[self] ||= [] @@subclasses[self] << child |