Skip to content
Browse files

only test for existence of +pool+ once

  • Loading branch information...
1 parent b952470 commit 04ef434b21f2143c3bea330d6861eac3696666ea @tenderlove tenderlove committed Jul 16, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
View
6 activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -343,9 +343,11 @@ def connected?(klass)
# 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)

0 comments on commit 04ef434

Please sign in to comment.
Something went wrong with that request. Please try again.