don't attempt a query unless a connection exists to do it on
This commit is contained in:
parent
20ef2e5e27
commit
56ecff58bf
@ -231,6 +231,7 @@ module ActiveRecord
|
|||||||
# CONNECTION MANAGEMENT ====================================
|
# CONNECTION MANAGEMENT ====================================
|
||||||
|
|
||||||
def active?
|
def active?
|
||||||
|
return false unless @connection
|
||||||
@connection.query 'select 1'
|
@connection.query 'select 1'
|
||||||
true
|
true
|
||||||
rescue Mysql2::Error
|
rescue Mysql2::Error
|
||||||
|
Loading…
Reference in New Issue
Block a user