mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
refactor if / else to ||=
This commit is contained in:
@@ -93,11 +93,7 @@ module ActiveRecord
|
||||
# #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.
|
||||
|
||||
Reference in New Issue
Block a user