diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-09-06 17:43:14 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-09-06 17:43:58 -0700 |
commit | 4edf6ea0eae9cb8be46a2e963e047eb89a0f5531 (patch) | |
tree | a45314930cb5532aa1579e0290d153be683facc6 /activerecord/lib/active_record/connection_adapters | |
parent | f6ced69a11cdff56c2e87b84e775ef09c6d999d1 (diff) | |
download | rails-4edf6ea0eae9cb8be46a2e963e047eb89a0f5531.tar.gz rails-4edf6ea0eae9cb8be46a2e963e047eb89a0f5531.tar.bz2 rails-4edf6ea0eae9cb8be46a2e963e047eb89a0f5531.zip |
Merge pull request #2897 from rsutphin/ar31-remove_connection
Patch for issue #2820
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb | 2 |
2 files changed, 2 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 61994d4a47..20863e73aa 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -421,7 +421,7 @@ module ActiveRecord # can be used as an argument for establish_connection, for easily # re-establishing the connection. def remove_connection(klass) - pool = @connection_pools[klass.name] + pool = @connection_pools.delete(klass.name) return nil unless pool pool.automatic_reconnect = false diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb index 7312e34f01..c08c0263b9 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb @@ -126,7 +126,7 @@ module ActiveRecord end def connection_pool - connection_handler.retrieve_connection_pool(self) + connection_handler.retrieve_connection_pool(self) or raise ConnectionNotEstablished end def retrieve_connection |