Module: UserAuthModel::ClassMethods

Defined in:
lib/user_auth_model.rb

Instance Method Summary collapse

Instance Method Details

#authenticate(email, password) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/user_auth_model.rb', line 12

def authenticate(email, password)
  user = self.get(:email => email)
  if user && user.encrypt(password) == user.password     
    user
  else
    nil
  end
end