Show old conferences in descending order

It is more likely that users look for recent conferences.

Fixes https://github.com/openSUSE/osem/issues/2331
This commit is contained in:
Jesus Castello 2019-03-02 22:06:36 +01:00
parent 1544cdd23e
commit ee50f25d46

View file

@ -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