Skip to content
This repository has been archived by the owner on Mar 21, 2019. It is now read-only.

Commit

Permalink
fix redirect loop
Browse files Browse the repository at this point in the history
  • Loading branch information
phamdt committed Mar 6, 2016
1 parent d6bb46e commit f4dcea2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ def mobile_device?
protected

def ref_to_cookie
return unless params.key?(:ref) || Rails.application.config.ended
campaign_ended = Rails.application.config.ended
return if campaign_ended || !params[:ref]

unless User.find_by_referral_code(params[:ref]).nil?
h_ref = { value: params[:ref], expires: 1.week.from_now }
cookies[:h_ref] = h_ref
Expand Down

0 comments on commit f4dcea2

Please sign in to comment.