Created
October 10, 2010 15:41
-
-
Save guilleiguaran/619336 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
class User | |
include MongoMapper::Document | |
extend Clearance::User::ClassMethods | |
include Clearance::User::InstanceMethods | |
include Clearance::User::Callbacks | |
include Clearance::User::AttrAccessor | |
key :confirmation_token, String | |
key :email, String, :unique => true | |
key :email_confirmed, Boolean | |
key :encrypted_password, String | |
key :password, String | |
key :remember_token, String | |
key :salt, String | |
def email_confirmed? | |
self.email_confirmed == true | |
end | |
def confirm_email! | |
self.email_confirmed = true | |
self.confirmation_token = nil | |
save #save(:validate => false) | |
end | |
def reset_remember_token! | |
generate_remember_token | |
save #save(:validate => false) | |
end | |
def forgot_password! | |
generate_confirmation_token | |
save #save(:validate => false) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment