Method: ActiveRecord::ConnectionHandling#lease_connection
- Defined in:
- activerecord/lib/active_record/connection_handling.rb
#lease_connection ⇒ Object
Returns the connection currently associated with the class. This can also be used to “borrow” the connection to do database work unrelated to any of the specific Active Records. The connection will remain leased for the entire duration of the request or job, or until #release_connection
is called.
269 270 271 |
# File 'activerecord/lib/active_record/connection_handling.rb', line 269 def lease_connection connection_pool.lease_connection end |