Skip to content

Instantly share code, notes, and snippets.

@jtrim
Created December 10, 2014 20:01
Show Gist options
  • Select an option

  • Save jtrim/dd6c5141ab5e89a386ad to your computer and use it in GitHub Desktop.

Select an option

Save jtrim/dd6c5141ab5e89a386ad to your computer and use it in GitHub Desktop.
class Activation
def initialize(user, activation_token)
@user, @activation_token = user, activation_token
end
def activate
if @user.activation_token == hash_token(@activation_token)
@user.update_attributes!({
activated_at: Time.now,
locked_at: nil,
activation_token: nil
})
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment