method
active?
v2.2.1 -
Show latest stable
- Class:
ActiveRecord::ConnectionAdapters::MysqlAdapter
active?()public
CONNECTION MANAGEMENT ====================================
# File activerecord/lib/active_record/connection_adapters/mysql_adapter.rb, line 264
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 Related methods
- Instance methods
- active?
- adapter_name
- add_limit_offset!
- begin_db_transaction
- case_sensitive_equality_operator
- change_column
- change_column_default
- change_column_null
- charset
- collation
- columns
- commit_db_transaction
- create_database
- create_table
- current_database
- disable_referential_integrity
- disconnect!
- drop_database
- drop_table
- execute
- indexes
- insert_sql
- limited_update_conditions
- native_database_types
- pk_and_sequence_for
- quote
- quote_column_name
- quote_string
- quote_table_name
- quoted_false
- quoted_true
- reconnect!
- recreate_database
- rename_column
- rename_table
- reset!
- rollback_db_transaction
- select_rows
- show_variable
- structure_dump
- supports_migrations?
- tables
- type_to_sql
- update_sql
- Class methods
- new
- Private methods
-
column_for -
configure_connection -
connect -
select -
supports_views? -
version