Created
March 10, 2009 01:13
-
-
Save TheNicholasNick/76599 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 User < CouchRest::ExtendedDocument | |
use_database CouchRest.database!(Merb::Config[:couchdb_url] + Merb::Config[:database]) | |
property :email | |
property :crypted_password | |
property :salt | |
save_callback :before, :encrypt_password | |
timestamps! | |
unique_id :set_id | |
couchrest_type = "user" | |
def authenticate(email, password) | |
#@u = first(Merb::Authentication::Strategies::Basic::Base.login_param => email) | |
#@u && @u.authenticated?(password) ? @u : nil | |
end | |
private | |
def set_id | |
"user_#{self['email']}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment