Created
December 10, 2014 20:01
-
-
Save jtrim/dd6c5141ab5e89a386ad to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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