aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-07-16 11:26:02 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-07-16 11:44:29 -0700
commit04ef434b21f2143c3bea330d6861eac3696666ea (patch)
treeeaceb84b08341f03b255271d20bf74a9f457ccdc /activerecord
parentb952470cc228ce4438226e180454bb141063b0ca (diff)
downloadrails-04ef434b21f2143c3bea330d6861eac3696666ea.tar.gz
rails-04ef434b21f2143c3bea330d6861eac3696666ea.tar.bz2
rails-04ef434b21f2143c3bea330d6861eac3696666ea.zip
only test for existence of +pool+ once
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb6
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)