From 3f68ca08f0d814558288e58ccadea3b333354051 Mon Sep 17 00:00:00 2001 From: francis Date: Wed, 6 Feb 2008 12:20:36 +0000 Subject: Links to user admin page and public body admin page from request admin page --- app/models/info_request.rb | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'app/models/info_request.rb') diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 68ace338a..d5c95b8ee 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -19,7 +19,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.34 2008-02-06 09:41:44 francis Exp $ +# $Id: info_request.rb,v 1.35 2008-02-06 12:20:37 francis Exp $ require 'digest/sha1' @@ -110,6 +110,19 @@ public RequestMailer.deliver_new_response(self, incoming_message) end + # Change status - event id is of the most recent event at the change + # XXX should probably check event id is last event here + def set_described_state(new_state, event_id) + ActiveRecord::Base.transaction do + self.awaiting_description = false + last_event = InfoRequestEvent.find(event_id) + last_event.described_state = new_state + self.described_state = new_state + last_event.save! + self.save! + end + end + # Work out what the situation of the request is # waiting_response # waiting_response_overdue # XXX calculated, should be cached for display? -- cgit v1.2.3