Merge pull request #2386 from matugm/fix-order

Show old conferences in descending order
This commit is contained in:
Ana María Martínez Gómez 2019-03-08 14:57:30 +01:00 committed by GitHub
commit 9e771e2368
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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