diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-08-07 14:45:27 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-08-15 10:12:04 +0100 |
commit | e709bfe80409a88dbfae7b62916781ac3ebd6f0b (patch) | |
tree | aa35ca9f645529bc393327d3040746fe61a01266 /app/models/info_request.rb | |
parent | e2154bdf9f5b4e389da50e6a073772aa3f59d11d (diff) |
Make admin edits affect info_request_event described_states.
Make sure that admin edits changing the described state of an info
request are reflected in the latest_status and status values of info
request events so that the info requests are retrieved correctly in
status-based searches.
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index d2e3fd02c..f6e216155 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -653,11 +653,12 @@ public # as that might already be set to waiting_clarification / a # success status, which we want to know about. curr_state = nil - elsif !curr_state.nil? && (event.event_type == 'status_update') - # A status update event should get the same calculated state as described state + elsif !curr_state.nil? && (['edit', 'status_update'].include? event.event_type) + # A status update or edit event should get the same calculated state as described state # so that the described state is always indexed (and will be the latest_status # for the request immediately after it has been described, regardless of what - # other request events precede it). It allows the described state to propagate in + # other request events precede it). This means that request should be correctly included + # in status searches for that status. These events allow the described state to propagate in # case there is a preceding response that the described state should be applied to. if event.calculated_state != event.described_state event.calculated_state = event.described_state |