Class: OkComputer::ActiveRecordMigrationsCheck

Inherits:
Check
  • Object
show all
Defined in:
lib/ok_computer/built_in_checks/active_record_migrations_check.rb

Constant Summary

Constants inherited from Check

Check::CheckNotDefined

Instance Attribute Summary

Attributes inherited from Check

#failure_occurred, #message, #registrant_name, #time

Instance Method Summary collapse

Methods inherited from Check

#<=>, #clear, #mark_failure, #mark_message, #run, #success?, #to_json, #to_text, #with_benchmarking

Instance Method Details

#checkObject

Public: Check if migrations are pending or not



4
5
6
7
8
9
10
11
12
13
# File 'lib/ok_computer/built_in_checks/active_record_migrations_check.rb', line 4

def check
  return mark_message(page_load_message) if check_on_page_load?

  error_if_pending_migrations(Rails.version)

  mark_message "NO pending migrations"
rescue ActiveRecord::PendingMigrationError
  mark_failure
  mark_message "Pending migrations"
end