class Rx::Check::ActiveRecordCheck

Attributes

name[R]

Public Class Methods

new(name = "activerecord") click to toggle source
# File lib/rx/check/active_record_check.rb, line 6
def initialize(name = "activerecord")
  @name = name
end

Public Instance Methods

check() click to toggle source
# File lib/rx/check/active_record_check.rb, line 10
def check
  Result.from(name) do
    unless activerecord_defined?
      raise StandardError.new("Undefined class ActiveRecord::Base")
    end

    ActiveRecord::Base.connection.active?
  end
end

Private Instance Methods

activerecord_defined?() click to toggle source
# File lib/rx/check/active_record_check.rb, line 22
def activerecord_defined?
  defined?(ActiveRecord::Base)
end