diff options
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index a1f2dcd7e..6c87d2457 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -22,7 +22,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.82 2008-04-04 02:29:09 francis Exp $ +# $Id: info_request.rb,v 1.83 2008-04-14 09:44:38 francis Exp $ require 'digest/sha1' @@ -459,6 +459,19 @@ public end end + # Completely delete this request and all objects depending on it + def fully_destroy + self.track_things.each do |track_thing| + track_thing.track_things_sent_emails.each { |a| a.destroy } + track_thing.destroy + end + self.incoming_messages.each { |a| a.destroy } + self.outgoing_messages.each { |a| a.destroy } + self.user_info_request_sent_alerts.each { |a| a.destroy } + self.info_request_events.each { |a| a.destroy } + self.destroy + end + # Called by incoming_email - and used to be called to generate separate # envelope from address until we abandoned it. def magic_email(prefix_part) |