Class: StatusCat::Checkers::ActiveRecord

Inherits:
Base
  • Object
show all
Defined in:
lib/status_cat/checkers/active_record.rb

Constant Summary

Constants inherited from Base

Base::FORMAT

Instance Attribute Summary

Attributes inherited from Base

#status, #value

Instance Method Summary collapse

Methods inherited from Base

class_to_name, #name, #to_s

Constructor Details

#initializeActiveRecord

Returns a new instance of ActiveRecord.



5
6
7
8
9
10
11
12
13
# File 'lib/status_cat/checkers/active_record.rb', line 5

def initialize
  config = ::ActiveRecord::Base.connection_config
  @value = "#{config[ :adapter ]}:#{config[ :username ]}@#{config[ :database ]}"

  @status = fail_on_exception do
    ::ActiveRecord::Base.connection.execute( "select max(version) from schema_migrations" )
    nil
  end
end