Refactored condition to check if splashpage is present.

This commit is contained in:
Marie-Elise 2018-01-15 22:23:38 -06:00 committed by James Mason
parent 34af9b840b
commit afff7e1c66

View file

@ -20,9 +20,11 @@ class ConferencesController < ApplicationController
authorize! :show, @conference # TODO: reduce the 10 queries performed here authorize! :show, @conference # TODO: reduce the 10 queries performed here
splashpage = @conference.splashpage splashpage = @conference.splashpage
if !splashpage.present?
redirect_to admin_conference_splashpage_path(@conference.short_title) unless splashpage.present?
else redirect_to admin_conference_splashpage_path(@conference.short_title) and return
end
if splashpage.include_cfp if splashpage.include_cfp
cfps = @conference.program.cfps cfps = @conference.program.cfps
@call_for_events = cfps.find { |call| call.cfp_type == 'events' } @call_for_events = cfps.find { |call| call.cfp_type == 'events' }
@ -55,7 +57,6 @@ class ConferencesController < ApplicationController
).order('sponsorship_levels.position ASC', 'sponsors.name') ).order('sponsorship_levels.position ASC', 'sponsors.name')
end end
end end
end
private private