diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2013-04-20 10:38:49 +1000 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2013-04-20 10:42:01 +1000 |
commit | 81090b8eb2d8d24072807062ccd5f32c8074069e (patch) | |
tree | 105a089c804a4463a10d65dd9f0f0c24f3e31360 /app/controllers/request_controller.rb | |
parent | 7deabcc40c6b40ad47dff2809c772e2186bd11d1 (diff) |
Now record a state_update event *whenever* a user classifies a request
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r-- | app/controllers/request_controller.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index ea84d3b10..7716ba7e7 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_controller.rb @@ -420,12 +420,22 @@ class RequestController < ApplicationController end # Make the state change + event = info_request.log_event("status_update", + { :user_id => authenticated_user.id, + :old_described_state => info_request.described_state, + :described_state => described_state, + }) + info_request.set_described_state(described_state, authenticated_user, message) # If you're not the *actual* requester. e.g. you are playing the # classification game, or you're doing this just because you are an # admin user (not because you also own the request). if !info_request.is_actual_owning_user?(authenticated_user) + # Create a classification event for league tables + RequestClassification.create!(:user_id => authenticated_user.id, + :info_request_event_id => event.id) + # Don't give advice on what to do next, as it isn't their request if session[:request_game] flash[:notice] = _('Thank you for updating the status of the request \'<a href="{{url}}">{{info_request_title}}</a>\'. There are some more requests below for you to classify.',:info_request_title=>CGI.escapeHTML(info_request.title), :url=>CGI.escapeHTML(request_path(info_request))) |