aboutsummaryrefslogtreecommitdiff
path: root/lib/mauve
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mauve')
-rw-r--r--lib/mauve/alert.rb20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/mauve/alert.rb b/lib/mauve/alert.rb
index 786ecab..ecea4e6 100644
--- a/lib/mauve/alert.rb
+++ b/lib/mauve/alert.rb
@@ -356,11 +356,25 @@ module Mauve
self.update_type = "cleared"
end
- unless save
+ if save
+ #
+ # Clear all reminders.
+ #
+ self.changes.all(:remind_at.not => nil, :at.lte => at, :update_type => "raised").each do |ac|
+ ac.remind_at = nil
+ ac.save
+ end
+
+ #
+ # Return true.
+ #
+ true
+ else
+ #
+ # Oops.
+ #
logger.error("Couldn't save #{self}")
false
- else
- true
end
end