Class: Rack::ECG::Check::MigrationVersion
- Inherits:
-
Object
- Object
- Rack::ECG::Check::MigrationVersion
- Defined in:
- lib/rack/ecg/check/migration_version.rb
Instance Method Summary collapse
-
#initialize ⇒ Object
constructor
Returns the latest applied ActiveRecord migration in the default database.
- #result ⇒ Object
Constructor Details
#initialize ⇒ Object
Returns the latest applied ActiveRecord migration in the default database.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rack/ecg/check/migration_version.rb', line 9 class MigrationVersion def result value = "" status = Status::OK begin if defined?(ActiveRecord) connection = ActiveRecord::Base.connection value = connection.select_value("select max(version) from schema_migrations") else status = Status::ERROR value = "ActiveRecord not found" end rescue => e status = Status::ERROR value = e. end Result.new(:migration_version, status, value) end end |
Instance Method Details
#result ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rack/ecg/check/migration_version.rb', line 10 def result value = "" status = Status::OK begin if defined?(ActiveRecord) connection = ActiveRecord::Base.connection value = connection.select_value("select max(version) from schema_migrations") else status = Status::ERROR value = "ActiveRecord not found" end rescue => e status = Status::ERROR value = e. end Result.new(:migration_version, status, value) end |