Advertisement
Guest User

Untitled

a guest
Jul 31st, 2017
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. def self.login(email, password)
  2. hashed_password = hash_password(password || "")
  3. @user = find(:first, :conditions => ["email = ? and hashed_password = ?", email, hashed_password])
  4. @user.datelastlogin = DateTime.now
  5. @user.save
  6. @user
  7. end
  8.  
  9. def try_to_login
  10. User.login(self.email, self.password)
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement