active?()
public
Is this connection alive and ready for queries?
Show source
def active?
if @connection.respond_to?(:status)
@connection.status == PGconn::CONNECTION_OK
else
@connection.query 'SELECT 1'
true
end
rescue PGError, NoMethodError
false
end