diff options
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 8 |
1 files changed, 3 insertions, 5 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 a609867898..46c7fc71ac 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -286,12 +286,10 @@ module ActiveRecord private def release(conn) - thread_id = nil - - if @reserved_connections[current_connection_id] == conn - thread_id = current_connection_id + thread_id = if @reserved_connections[current_connection_id] == conn + current_connection_id else - thread_id = @reserved_connections.keys.find { |k| + @reserved_connections.keys.find { |k| @reserved_connections[k] == conn } end |