Class: GranPulse::Database
- Defined in:
- app/models/gran_pulse/database.rb
Instance Attribute Summary
Attributes inherited from Check
Instance Method Summary collapse
-
#initialize ⇒ Database
constructor
A new instance of Database.
- #perform ⇒ Object
Constructor Details
#initialize ⇒ Database
Returns a new instance of Database.
3 4 5 |
# File 'app/models/gran_pulse/database.rb', line 3 def initialize self.type = 'database' end |
Instance Method Details
#perform ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/models/gran_pulse/database.rb', line 7 def perform if defined?(ActiveRecord) if ActiveRecord::Base.connected? self.healthy = true self. = 'ok' else self.healthy = false self. = 'no_database_connected' end # elsif defined?(Mongoid) # config = else self.healthy = true self. = 'no_database_defined' end self end |