diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-18 23:37:11 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-18 23:37:37 -0700 |
commit | 072cd60379dfee830845f32cb81019584d619331 (patch) | |
tree | 4a43e2f558bbd4ef267716f547cddc0ed15c0a2a /activerecord | |
parent | 5a1d957dcecc1996defcb6236334fc680e4a5d4a (diff) | |
download | rails-072cd60379dfee830845f32cb81019584d619331.tar.gz rails-072cd60379dfee830845f32cb81019584d619331.tar.bz2 rails-072cd60379dfee830845f32cb81019584d619331.zip |
refactor if / else to ||=
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb | 6 |
1 files changed, 1 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 288ce5aebb..857af1baf7 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -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. |