-
-
Save epitron/2fe167b067484638979500e361ac5cb3 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 PasswordReset < ActiveRecord::Base | |
belongs_to :user | |
before_save :generate_random_token | |
def expired? | |
created_at < 3.days.ago | |
end | |
private | |
def generate_random_token | |
self.token = SecureRandom.uuid | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment