Skip to content

Instantly share code, notes, and snippets.

@rgould
Forked from amandarae/gist:3314217
Created August 10, 2012 14:50
Show Gist options
  • Save rgould/3314753 to your computer and use it in GitHub Desktop.
Save rgould/3314753 to your computer and use it in GitHub Desktop.
def welcome
@show_splash = false
if @current_user
redirect_to home_path(@current_brand)
else
@ct_deal = nil
@biz_deal = nil
@kidz_deal = nil
Deal.live_by_brand("gaggleup", @current_region).each do |chkdeal|
if check_for_exclusive_deal_access(chkdeal, @current_user)
if @ct_deal.nil? && chkdeal != @biz_deal && chkdeal != @kidz_deal && chkdeal.brands.include?(Brand.ctfs)
@ct_deal = chkdeal
end
if @biz_deal.nil? && chkdeal != @ct_deal && chkdeal != @kidz_deal && chkdeal.brands.include?(Brand.gagglebiz)
@biz_deal = chkdeal
end
if @kidz_deal.nil? && chkdeal != @ct_deal && chkdeal != @biz_deal && chkdeal.brands.include?(Brand.gagglekidz)
@kidz_deal = chkdeal
end
end
break if @ct_deal && @biz_deal && @kidz_deal
end
render layout: false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment