mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
optimize queries
This commit is contained in:
parent
8a422412d6
commit
7d5d935a65
8 changed files with 101 additions and 43 deletions
|
|
@ -6,8 +6,9 @@ class ConferencesController < ApplicationController
|
|||
load_and_authorize_resource find_by: :short_title, except: :show
|
||||
|
||||
def index
|
||||
@current = Conference.where('end_date >= ?', Date.current).reorder(start_date: :asc)
|
||||
@antiquated = @conferences - @current
|
||||
@current, @antiquated = Conference.reorder(start_date: :asc).all.partition do |conference|
|
||||
conference.end_date >= Date.current
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue