diff options
author | francis <francis> | 2008-05-16 01:14:12 +0000 |
---|---|---|
committer | francis <francis> | 2008-05-16 01:14:12 +0000 |
commit | dd1fed05800d9b58b3b48a90602bcadd0c20aa44 (patch) | |
tree | 94060313d22da960b87dcf736b52056995851292 | |
parent | 93d2b1e2f2ef663fab39265017f3bc346a72bf48 (diff) |
Due to new alert types, can have a link between event and fact that sent
which is not of the request being tracked.
-rw-r--r-- | app/models/info_request.rb | 7 | ||||
-rw-r--r-- | app/models/track_things_sent_email.rb | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index b760d5910..dec1fe78d 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -21,7 +21,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request.rb,v 1.109 2008-05-15 17:40:43 francis Exp $ +# $Id: info_request.rb,v 1.110 2008-05-16 01:14:12 francis Exp $ require 'digest/sha1' require File.join(File.dirname(__FILE__),'../../vendor/plugins/acts_as_xapian/lib/acts_as_xapian') @@ -462,7 +462,10 @@ public track_thing.destroy end self.user_info_request_sent_alerts.each { |a| a.destroy } - self.info_request_events.each { |a| a.destroy } + self.info_request_events.each do |info_request_event| + info_request_event.track_things_sent_emails.each { |a| a.destroy } + info_request_event.destroy + end self.incoming_messages.each { |a| a.destroy } self.outgoing_messages.each { |a| a.destroy } self.destroy diff --git a/app/models/track_things_sent_email.rb b/app/models/track_things_sent_email.rb index 71b231794..4e6ce3001 100644 --- a/app/models/track_things_sent_email.rb +++ b/app/models/track_things_sent_email.rb @@ -18,12 +18,13 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: track_things_sent_email.rb,v 1.4 2008-05-12 01:38:18 francis Exp $ +# $Id: track_things_sent_email.rb,v 1.5 2008-05-16 01:14:12 francis Exp $ class TrackThingsSentEmail < ActiveRecord::Base belongs_to :info_request_event belongs_to :user belongs_to :public_body + belongs_to :track_thing end |