instance method
connection
Ruby on Rails 3.1.12
Since v2.2.3 Last seen in v7.2.3Signature
connection()
Retrieve the connection associated with the current thread, or call #checkout to obtain one if necessary.
#connection can be called any number of times; the connection is held in a hash keyed by the thread id.
Source
# File activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb, line 161
def connection
@reserved_connections[current_connection_id] ||= checkout
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb line 161
· View on GitHub
· Improve this page
· Find usages on GitHub