Module: AutoAlert::ActsAsAlertable::LocalInstanceMethods
- Defined in:
- lib/auto_alert/acts_as_alertable.rb
Instance Method Summary collapse
- #has_unresolved_alerts? ⇒ Boolean
-
#scan_for_alerts! ⇒ Object
Check if any alerts should be raised or resolveed.
- #unresolved_alerts ⇒ Object
Instance Method Details
#has_unresolved_alerts? ⇒ 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_alerts ⇒ Object
18 19 20 |
# File 'lib/auto_alert/acts_as_alertable.rb', line 18 def unresolved_alerts alerts.where(resolved: false) end |