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

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

Sourcecode
# File src/rails-1.1.3/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 145
      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