diff options
author | francis <francis> | 2008-02-06 12:20:36 +0000 |
---|---|---|
committer | francis <francis> | 2008-02-06 12:20:36 +0000 |
commit | 3f68ca08f0d814558288e58ccadea3b333354051 (patch) | |
tree | 3003f25fc7b9f942b3566767809dc067a05ce906 /app/models/info_request.rb | |
parent | f7b020796a743877e24295423527e448111ec065 (diff) |
Links to user admin page and public body admin page from request admin page
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 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? |