Method: AppStatus::Adapters::ActiveRecord.status

Defined in:
lib/app_status/adapters/active_record.rb

.statusObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/app_status/adapters/active_record.rb', line 4

def self.status
  if defined?(::ActiveRecord)
    ::ActiveRecord::Base.connection.execute("SELECT 1=1").first.present? ? 'OK' : 'o_O'
  else
    'N/A'
  end
rescue => e
  AppStatus.logger.error "STATUS ERROR: #{adapter_name}"
  AppStatus.logger.error e
  'Down'
end