Class: NtqTools::Monitors::Database

Inherits:
Base
  • Object
show all
Defined in:
lib/ntq_tools/monitors/database.rb

Class Method Summary collapse

Class Method Details

.checkObject



15
16
17
18
19
20
21
22
23
# File 'lib/ntq_tools/monitors/database.rb', line 15

def check
  begin
    themodel = ActiveRecord::Base.descendants.find { |model| model.table_exists? && !model.abstract_class? }
    themodel.first
    return true
  rescue
    return false
  end
end

.is_installed?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/ntq_tools/monitors/database.rb', line 11

def is_installed?
  defined?(::ActiveRecord).present?
end

.nameObject



7
8
9
# File 'lib/ntq_tools/monitors/database.rb', line 7

def name
  "database"
end