Merge pull request #2629 from esparta/conference_index_dry
DRY on controllers/conferences_controller#index
This commit is contained in:
commit
d928be7e18
1 changed files with 2 additions and 2 deletions
|
|
@ -6,8 +6,8 @@ class ConferencesController < ApplicationController
|
||||||
load_and_authorize_resource find_by: :short_title, except: :show
|
load_and_authorize_resource find_by: :short_title, except: :show
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@current = Conference.where('end_date >= ?', Date.current).reorder(start_date: :asc)
|
@current = Conference.upcoming.reorder(start_date: :asc)
|
||||||
@antiquated = Conference.where('end_date < ?', Date.current)
|
@antiquated = Conference.past
|
||||||
if @antiquated.empty? && @current.empty? && User.empty?
|
if @antiquated.empty? && @current.empty? && User.empty?
|
||||||
render :new_install
|
render :new_install
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue