instance method
active_connection?
Ruby on Rails 4.0.13
Since v3.1.12Signature
active_connection?()
Is there an open connection that is being used for the current thread?
Source
# File activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb, line 270
def active_connection?
synchronize do
@reserved_connections.fetch(current_connection_id) {
return false
}.in_use?
end
end
Defined in activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb line 270
· View on GitHub
· Improve this page
· Find usages on GitHub