method

lease_connection

rails latest stable - Class: ActiveRecord::ConnectionHandling

Method not available on this version

This method is only available on newer versions. The first available version (v7.2.3) is shown here.

lease_connection()
public

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.