Class: OkComputer::ActiveRecordCheck
- Defined in:
- lib/ok_computer/built_in_checks/active_record_check.rb
Constant Summary collapse
- ConnectionFailed =
Class.new(StandardError)
Constants inherited from Check
Instance Attribute Summary
Attributes inherited from Check
#failure_occurred, #message, #registrant_name, #time
Instance Method Summary collapse
-
#check ⇒ Object
Public: Return the schema version of the database.
-
#schema_version ⇒ Object
Public: The scema version of the app’s database.
Methods inherited from Check
#<=>, #clear, #mark_failure, #mark_message, #run, #success?, #to_json, #to_text, #with_benchmarking
Instance Method Details
#check ⇒ Object
Public: Return the schema version of the database
4 5 6 7 8 9 |
# File 'lib/ok_computer/built_in_checks/active_record_check.rb', line 4 def check "Schema version: #{schema_version}" rescue ConnectionFailed => e mark_failure "Error: '#{e}'" end |
#schema_version ⇒ Object
Public: The scema version of the app’s database
Returns a String with the version number
14 15 16 17 18 |
# File 'lib/ok_computer/built_in_checks/active_record_check.rb', line 14 def schema_version ActiveRecord::Migrator.current_version rescue => e raise ConnectionFailed, e end |