diff options
Diffstat (limited to 'lib/mauve')
-rw-r--r-- | lib/mauve/alert_group.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/mauve/alert_group.rb b/lib/mauve/alert_group.rb index fe78ad9..1889e64 100644 --- a/lib/mauve/alert_group.rb +++ b/lib/mauve/alert_group.rb @@ -236,15 +236,17 @@ module Mauve # OK got the next reminder time. # unless remind_at.nil? - this_reminder = AlertChanged.new( - :level => level.to_s, + this_reminder = AlertChanged.first_or_new( :alert_id => alert.id, :person => self.name, - :at => at, - :update_type => alert.update_type, - :remind_at => remind_at, - :was_relevant => true) + :remind_at.not => nil + ) + 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 end |