Skip to content

Instantly share code, notes, and snippets.

@conradchu
Created December 6, 2012 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conradchu/4222687 to your computer and use it in GitHub Desktop.
Save conradchu/4222687 to your computer and use it in GitHub Desktop.
if @new_user.save
if @invitation && @invitation.persisted?
# Mark private invites as used.
@invitation.deactivate unless @invitation.public?
# Send referrer feedback/rewards when the new user signs up.
@invitation.delay.reward_referrer_on_signup(@new_user)
end
session[:referrer_code] = nil
# Attempt to post sign up to FB wall if we are permitted to
Authentication.post_signup_to_fb(@new_user) if params[:share_friends] == 'yes'
flash[:mixpanel_analytics] = 'Customer Signup'
flash[:km_analytics] = "['record', 'signed up']"
# sign in and redirect
session[:user_return_to] ||= params[:return] || welcome_users_cp_path
sign_in_and_redirect @new_user and return
else
failure and return
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment