diff options
author | Gareth Rees <gareth@mysociety.org> | 2014-10-01 14:02:40 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-12-18 15:16:38 +0000 |
commit | 01625ed1baef70c23499124afe090642665a6157 (patch) | |
tree | 601f9508c8d1c60744795bfaf0e05f9fdb0ca8dd /app/models/info_request.rb | |
parent | 81bab2df2426bb0229aa769207b14e573f3515b7 (diff) |
Improve InfoRequest.find_in_state SQL
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index d0052603a..74c245e56 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -1345,9 +1345,9 @@ public end def InfoRequest.find_in_state(state) - find(:all, :select => '*, ' + last_event_time_clause + ' as last_event_time', - :conditions => ["described_state = ?", state], - :order => "last_event_time") + select("*, #{ last_event_time_clause } as last_event_time"). + where(:described_state => state). + order('last_event_time') end private |