Module: AutoAlert::ActsAsAlertable::LocalInstanceMethods

Defined in:
lib/auto_alert/acts_as_alertable.rb

Instance Method Summary collapse

Instance Method Details

#has_unresolved_alerts?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/auto_alert/acts_as_alertable.rb', line 22

def has_unresolved_alerts?
  unresolved_alerts.size > 0
end

#scan_for_alerts!Object

Check if any alerts should be raised or resolveed



27
28
29
30
31
# File 'lib/auto_alert/acts_as_alertable.rb', line 27

def scan_for_alerts!
  self.class.alert_checkers.each do |checker|
    checker.check(self)
  end
end

#unresolved_alertsObject



18
19
20
# File 'lib/auto_alert/acts_as_alertable.rb', line 18

def unresolved_alerts
  alerts.where(resolved: false)
end