From a54a32084e9870af6f1ede97887c2332c21e812c Mon Sep 17 00:00:00 2001 From: Patrick J Cherry Date: Wed, 10 Aug 2011 16:05:20 +0100 Subject: Added ability to tag multiple alerts with the same history item. --- lib/mauve/person.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/mauve/person.rb') diff --git a/lib/mauve/person.rb b/lib/mauve/person.rb index 1a5f2c9..58d696c 100644 --- a/lib/mauve/person.rb +++ b/lib/mauve/person.rb @@ -72,10 +72,10 @@ module Mauve # Log the result note = "#{@alert.update_type.capitalize} #{name} notification to #{@person.username} (#{destination}) " + (res ? "succeeded" : "failed" ) logger.info note+" about #{@alert}." - h = History.new(:alert_id => @alert.id, :type => "notification", :event => note) + h = History.new(:alerts => [@alert], :type => "notification", :event => note) logger.error "Unable to save history due to #{h.errors.inspect}" if !h.save - res + return res end end @@ -191,7 +191,7 @@ module Mauve if was_suppressed and self.suppressed? note = "#{alert.update_type.capitalize} notification to #{self.username} suppressed" logger.info note + " about #{alert}." - History.create(:alert_id => alert.id, :type => "notification", :event => note) + History.create(:alerts => [alert], :type => "notification", :event => note) return true end -- cgit v1.2.1