From ee50f25d4612f10aa6b9464aa6254956901fec4f Mon Sep 17 00:00:00 2001 From: Jesus Castello Date: Sat, 2 Mar 2019 22:06:36 +0100 Subject: [PATCH] Show old conferences in descending order It is more likely that users look for recent conferences. Fixes https://github.com/openSUSE/osem/issues/2331 --- app/controllers/conferences_controller.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index 05f98d6d..035ab366 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -6,9 +6,8 @@ class ConferencesController < ApplicationController load_and_authorize_resource find_by: :short_title, except: :show def index - @current, @antiquated = Conference.reorder(start_date: :asc).all.partition do |conference| - conference.end_date >= Date.current - end + @current = Conference.where('end_date >= ?', Date.current).reorder(start_date: :asc) + @antiquated = Conference.where('end_date < ?', Date.current) end def show