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 ====================================
|
||||
|
||||
def active?
|
||||
return false unless @connection
|
||||
@connection.query 'select 1'
|
||||
true
|
||||
rescue Mysql2::Error
|
||||
|
|
Loading…
Reference in New Issue