active?() Ver: 1.2.2
From: ActiveRecord::ConnectionAdapters::PostgreSQLAdapter Version 1.2.2
Comments

Is this connection alive and ready for queries?

Sourcecode
# File src/rails-1.2.2/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb, line 63
      def active?
        if @connection.respond_to?(:status)
          @connection.status == PGconn::CONNECTION_OK
        else
          @connection.query 'SELECT 1'
          true
        end
      # postgres-pr raises a NoMethodError when querying if no conn is available
      rescue PGError, NoMethodError
        false
      end
Add New Note User Added Notes