Method: ActiveRecord::ConnectionAdapters::ConnectionPool#active_connection

Defined in:
lib/active_record/connection_adapters/abstract/connection_pool.rb

#active_connectionBoolean

Returns true if there is an open connection being used for the current thread.

This method only works for connections that have been obtained through #lease_connection or #with_connection methods. Connections obtained through #checkout will not be detected by #active_connection? :nodoc:

Returns:

  • (Boolean)


422
423
424
# File 'lib/active_record/connection_adapters/abstract/connection_pool.rb', line 422

def active_connection?
  connection_lease.connection
end