diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-11-27 09:58:20 +0000 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-11-27 09:58:20 +0000 |
commit | 8354c4de287390b83a44eff964d5ca3a71e38a85 (patch) | |
tree | 49766fbcb995eaf96f9f77cf6f590157bfa9e43e /lib/mauve | |
parent | 29ba7950e799b3693d08b5f7913b62a76cc57f3d (diff) |
Reverted change to alert_changed now there's the validation monkey
patch in places.
Diffstat (limited to 'lib/mauve')
-rw-r--r-- | lib/mauve/alert_changed.rb | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/lib/mauve/alert_changed.rb b/lib/mauve/alert_changed.rb index b76df58..3c5fa0f 100644 --- a/lib/mauve/alert_changed.rb +++ b/lib/mauve/alert_changed.rb @@ -108,22 +108,10 @@ module Mauve # self.remind_at = nil - 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 + # + # Now save. + # + return self.save end # The time this AlertChanged should next be polled at, or nil. Mimics |