diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-16 11:26:02 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-07-16 11:44:29 -0700 |
commit | 04ef434b21f2143c3bea330d6861eac3696666ea (patch) | |
tree | eaceb84b08341f03b255271d20bf74a9f457ccdc /activerecord/lib/active_record/connection_adapters/abstract | |
parent | b952470cc228ce4438226e180454bb141063b0ca (diff) | |
download | rails-04ef434b21f2143c3bea330d6861eac3696666ea.tar.gz rails-04ef434b21f2143c3bea330d6861eac3696666ea.tar.bz2 rails-04ef434b21f2143c3bea330d6861eac3696666ea.zip |
only test for existence of +pool+ once
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 6 |
1 files changed, 4 insertions, 2 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 5dcc625ade..1b4ee0368e 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -343,9 +343,11 @@ module ActiveRecord # re-establishing the connection. def remove_connection(klass) pool = @connection_pools[klass.name] + return nil unless pool + @connection_pools.delete_if { |key, value| value == pool } - pool.disconnect! if pool - pool.spec.config if pool + pool.disconnect! + pool.spec.config end def retrieve_connection_pool(klass) |