Created
March 4, 2017 00:14
-
-
Save danadaldos/05ec7f52844195e9f1399ced46f9a209 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def edit | |
@rejoin = true | |
@user = current_user | |
@international = params[:international] == "true" | |
@plan = params[:plan] || "twelve" | |
if !@user | |
@email = params[:email] || "" | |
@secret_code = params[:key] | |
@user = User.where("lower(email) = ? AND secret_code = ?", @email.downcase, @secret_code).first | |
session[:my_current_user] = @user.secret_code if @user | |
end | |
redirect_to root_path and return if !@user | |
#sign_in(@user) | |
@cancel = @user.cancels.new | |
if @user.present? && @user.validate_cheddargetter | |
@iframe_url = @international ? @user.cheddargetter_update_iframe_url_international(@plan) : @user.cheddargetter_update_iframe_url(@plan) | |
else | |
@iframe_url = @user.cheddargetter_create_iframe_url | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment