refactor if / else to ||=

This commit is contained in:
Aaron Patterson 2010-08-18 23:37:11 -07:00
parent 5a1d957dce
commit 072cd60379
1 changed files with 1 additions and 5 deletions

View File

@ -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.