Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactor if / else to ||=

  • Loading branch information...
commit 072cd60379dfee830845f32cb81019584d619331 1 parent 5a1d957
@tenderlove tenderlove authored
View
6 activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
@@ -93,11 +93,7 @@ def initialize(spec)
# #connection can be called any number of times; the connection is
# held in a hash keyed by the thread id.
def connection
- if conn = @reserved_connections[current_connection_id]
- conn
- else
- @reserved_connections[current_connection_id] = checkout
- end
+ @reserved_connections[current_connection_id] ||= checkout
end
# Signal that the thread is finished with the current connection.
Please sign in to comment.
Something went wrong with that request. Please try again.