aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/mauve/alert.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/mauve/alert.rb b/lib/mauve/alert.rb
index 024ce5c..ab13736 100644
--- a/lib/mauve/alert.rb
+++ b/lib/mauve/alert.rb
@@ -217,19 +217,18 @@ module Mauve
# The alert subject
#
# @return [String]
- def subject; attribute_get(:subject) || attribute_get(:source) || "not set" ; end
+ def subject; super || self.source || "not set" ; end
# The alert detail
#
# @return [String]
- def detail; attribute_get(:detail) || "_No detail set._" ; end
+ def detail; super || "_No detail set._" ; end
#
# Set the subject -- this clears the cached_alert_group.
#
def subject=(s)
self.cached_alert_group = nil
- @subject_ips = nil
attribute_set(:subject, s)
end
@@ -288,7 +287,7 @@ module Mauve
# This is to stop datamapper inserting duff dates into the database.
#
def check_dates
- bad_dates = self.attributes.find_all do |key, value|
+ bad_dates = self.dirty_attributes.find_all do |key, value|
value.is_a?(Time) and (value < (Time.now - 3650.days) or value > (Time.now + 3650.days))
end
@@ -299,7 +298,6 @@ module Mauve
end
end
-
# Remove all history for an alert, when an alert is destroyed.
#
#