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

CONNECTION MANAGEMENT ====================================

Sourcecode
# File src/rails-1.2.2/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 215
      def active?
        if @connection.respond_to?(:stat)
          @connection.stat
        else
          @connection.query 'select 1'
        end

        # mysql-ruby doesn't raise an exception when stat fails.
        if @connection.respond_to?(:errno)
          @connection.errno.zero?
        else
          true
        end
      rescue Mysql::Error
        false
      end
Add New Note User Added Notes