Solved Issue 1259

This commit is contained in:
divyanshumehta 2017-02-11 16:45:27 +05:30
parent 42741fa90b
commit 529b8eb710
4 changed files with 21 additions and 3 deletions

View file

@ -0,0 +1,10 @@
class RootRouteConstraint
def initialize
@current = Conference.where('end_date >= ?', Date.current).reorder(start_date: :asc)
end
def matches?(*)
return unless @current.present? && @current.first.splashpage.present?
@current.count == 1 && @current.first.splashpage.public?
end
end