method

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

with_connection(prevent_permanent_checkout: false, &block)
public

Checkouts a connection from the pool, yield it and then check it back in. If a connection was already leased via #lease_connection or a parent call to #with_connection, that same connection is yieled. If #lease_connection is called inside the block, the connection won’t be checked back in. If #connection is called inside the block, the connection won’t be checked back in unless the prevent_permanent_checkout argument is set to true.