aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2013-05-01 15:41:03 +0100
committerPatrick J Cherry <patrick@bytemark.co.uk>2013-05-01 15:41:03 +0100
commit344e58f4ca599e22fab7234b2c72080376dfa083 (patch)
treee8b7d3ab0cc797f6aa499e2e35b00bc2f3f63f9a /lib
parent0267aaa13b2513cd40451932334ca72fbb62f2c0 (diff)
Further update to alert_group to find the last reminder for the same update type.
Diffstat (limited to 'lib')
-rw-r--r--lib/mauve/alert_group.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/mauve/alert_group.rb b/lib/mauve/alert_group.rb
index 424ba88..fe17516 100644
--- a/lib/mauve/alert_group.rb
+++ b/lib/mauve/alert_group.rb
@@ -236,16 +236,19 @@ module Mauve
# OK got the next reminder time.
#
unless remind_at.nil?
+ #
+ # Find the last reminder, if available for the same alert, update type, and person.
+ #
this_reminder = AlertChanged.first_or_new(
:alert_id => alert.id,
:person => self.name,
+ :update_type => alert.update_type,
:remind_at.not => nil,
:remind_at.gt => at
)
this_reminder.level = level.to_s
this_reminder.at = at
- this_reminder.update_type = alert.update_type
this_reminder.remind_at = remind_at
this_reminder.was_relevant = true
this_reminder.save