Module: Userify::User::ClassMethods

Defined in:
lib/userify/user.rb

Instance Method Summary collapse

Instance Method Details

#authenticate(email_or_username, password) ⇒ Object



105
106
107
108
# File 'lib/userify/user.rb', line 105

def authenticate(email_or_username, password)
  user = find(:first, :conditions => ['username = ? OR email = ?', email_or_username, email_or_username])
  user && user.authenticated?(password) ? user : nil
end