Redirect home to conference#show if only one conference live tommorow

This commit is contained in:
divyanshumehta 2017-04-16 10:42:46 +05:30
parent ee7684d845
commit d425349bdd
3 changed files with 4 additions and 7 deletions

View file

@ -13,6 +13,7 @@ class ConferencesController < ApplicationController
def current
current = Conference.where('start_date <= ? AND end_date >= ?', Date.current, Date.current).first
current = Conference.where('start_date = ?', Date.current + 1).first if current.blank?
redirect_to conference_path(current.short_title)
end