aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick J Cherry <patrick@bytemark.co.uk>2012-12-05 12:31:08 +0000
committerPatrick J Cherry <patrick@bytemark.co.uk>2012-12-05 12:31:08 +0000
commitdebded63c18e4cb01faa8306c727c0c0472852bc (patch)
treeb167ae3662a1da38befed9152d261eec332ab68d /lib
parent0c913e76a27c9859aa8be0ab39e28f11b585ae0d (diff)
Make sure the update_type is always set on save.
Diffstat (limited to 'lib')
-rw-r--r--lib/mauve/alert.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/mauve/alert.rb b/lib/mauve/alert.rb
index cbf4a40..82f9e91 100644
--- a/lib/mauve/alert.rb
+++ b/lib/mauve/alert.rb
@@ -209,11 +209,6 @@ module Mauve
def detail; super || "_No detail set._" ; end
#
- # The update type
- #
- def update_type; super || "cleared" ; end
-
- #
# Set the subject -- this clears the cached_alert_group.
#
def subject=(s)
@@ -338,10 +333,7 @@ module Mauve
history = nil
- if ut.nil?
- self.update_type = "cleared" if self.new? or self.update_type.nil?
-
- else
+ unless ut.nil?
self.update_type = ut
history = History.new(:alerts => [self], :type => "update")
@@ -364,6 +356,11 @@ module Mauve
end
end
+ #
+ # Make sure the update type is always set.
+ #
+ self.update_type = "cleared" if self.update_type.nil?
+
self.raise_on_save_failure = true
begin