diff options
author | Nick Sieger <nick@nicksieger.com> | 2008-08-26 11:08:06 -0500 |
---|---|---|
committer | Nick Sieger <nick@nicksieger.com> | 2008-08-29 14:12:13 -0500 |
commit | 300754509b6990b387b056c122e90f50a79eeb81 (patch) | |
tree | f2ac6744c662a72cfc0657c14d4f12455d6523d2 /activerecord/lib/active_record | |
parent | 113cc4e1c41b8246b8f6327b58bd315be72469e7 (diff) | |
download | rails-300754509b6990b387b056c122e90f50a79eeb81.tar.gz rails-300754509b6990b387b056c122e90f50a79eeb81.tar.bz2 rails-300754509b6990b387b056c122e90f50a79eeb81.zip |
Minor tweak to retrieve_connection_pool -- recurse instead of loop
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb index fe6ba47d69..838b0434b0 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -271,12 +271,10 @@ module ActiveRecord end def retrieve_connection_pool(klass) - loop do - pool = @connection_pools[klass.name] - return pool if pool - return nil if ActiveRecord::Base == klass - klass = klass.superclass - end + pool = @connection_pools[klass.name] + return pool if pool + return nil if ActiveRecord::Base == klass + retrieve_connection_pool klass.superclass end end end |