diff options
author | Matthew Landauer <matthew@openaustralia.org> | 2012-10-26 08:59:22 +1100 |
---|---|---|
committer | Matthew Landauer <matthew@openaustralia.org> | 2012-10-26 08:59:22 +1100 |
commit | f06fd4702af107efcce1f164f534d57fa79b7653 (patch) | |
tree | d5cbca4eb2ae3dca46ecedac2875a54ae4b074d4 /app/controllers/general_controller.rb | |
parent | 46c160d3b7b121ccda404c56e2cc54f48b16703d (diff) |
Always have the newest events at the top of the list
Diffstat (limited to 'app/controllers/general_controller.rb')
-rw-r--r-- | app/controllers/general_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 3fdfb4b0b..0cde238cd 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -58,6 +58,8 @@ class GeneralController < ApplicationController xapian_object = perform_search([InfoRequestEvent], query, sortby, 'request_title_collapse', max_count-@request_events.count) more_events = xapian_object.results.map { |r| r[:model] } @request_events += more_events + # Overall we still want the list sorted with the newest first + @request_events.sort!{|e1,e2| e2.created_at <=> e1.created_at} else @request_events_all_successful = true end |