diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2014-07-03 12:01:25 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2014-07-03 12:01:25 +0100 |
commit | 02cd939814dc8aebc80b5a23a3ba6b68f4118864 (patch) | |
tree | 3e74d4e098187fc8e8536c9cef98efa15347c3b0 /lib/mauve/alert.rb | |
parent | f6ddf58350e015ee49d35d3ac4a74cce53e62102 (diff) | |
parent | 9e8ee3bec749abf11a71003efd201e1e3fb0843f (diff) |
Merge
Diffstat (limited to 'lib/mauve/alert.rb')
-rw-r--r-- | lib/mauve/alert.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/mauve/alert.rb b/lib/mauve/alert.rb index a2033a5..24b9dae 100644 --- a/lib/mauve/alert.rb +++ b/lib/mauve/alert.rb @@ -824,7 +824,10 @@ module Mauve # alert.id = Alert.remove_html(alert.id.to_s) - alert_db = first(:alert_id => alert.id, :source => update.source) || + # + # Load the database alert, and all its properties, since we're updating. + # + alert_db = first(:alert_id => alert.id, :source => update.source, :fields => Alert.properties) || new(:alert_id => alert.id, :source => update.source) ## @@ -850,6 +853,11 @@ module Mauve alert_db.raised_at = nil alert_db.will_raise_at = raise_time end + else + # + # If no raise time has been set, then update the database to reflect this. + # + alert_db.raised_at = alert_db.will_raise_at = nil end if clear_time @@ -863,6 +871,11 @@ module Mauve alert_db.cleared_at = nil alert_db.will_clear_at = clear_time end + else + # + # If no clear time has been set, then update the database to reflect this. + # + alert_db.cleared_at = alert_db.will_clear_at = nil end # |