From 344e58f4ca599e22fab7234b2c72080376dfa083 Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Wed, 1 May 2013 15:41:03 +0100 Subject: Further update to alert_group to find the last reminder for the same update type. --- lib/mauve/alert_group.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1