instance method active?

Ruby on Rails 2.3.18

Last seen in v3.0.20

Available in: v2.2.3 v2.3.18 v3.0.20

Signature

active?()

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

Source
# File activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 275
      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

Defined in activerecord/lib/active_record/connection_adapters/mysql_adapter.rb line 275 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveRecord::ConnectionAdapters::MysqlAdapter

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close