aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mauve/alert_changed.rb17
-rw-r--r--lib/mauve/version.rb2
2 files changed, 17 insertions, 2 deletions
diff --git a/lib/mauve/alert_changed.rb b/lib/mauve/alert_changed.rb
index 2e3ac7d..b76df58 100644
--- a/lib/mauve/alert_changed.rb
+++ b/lib/mauve/alert_changed.rb
@@ -108,7 +108,22 @@ module Mauve
#
self.remind_at = nil
- save
+ unless self.save
+ #
+ # If the save has failed due to validation errors, but there aren't
+ # actually any errors, just save, by-passing validation.
+ #
+ if self.respond_to?("errors") and self.errors.is_a?(DataMapper::Validations::ValidationErrors) and self.errors.errors.empty?
+ logger.debug "Failed to save #{self.inspect} due to unexplained validation error. Saving again skipping validation."
+ self.save!
+ return true
+ else
+ logger.warn "Failed to clear #{self.inspect}, due to #{self.errors.inspect} -- this will lead to duplicate reminders."
+ return false
+ end
+ end
+
+ return true
end
# The time this AlertChanged should next be polled at, or nil. Mimics
diff --git a/lib/mauve/version.rb b/lib/mauve/version.rb
index 3b443c9..bd0e8cf 100644
--- a/lib/mauve/version.rb
+++ b/lib/mauve/version.rb
@@ -5,6 +5,6 @@ module Mauve
#
# Current version
- VERSION="3.11.3"
+ VERSION="3.11.4"
end