Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user = User.new(name: 'anuj', password: '')
- user.save # => false
- # Method to set password
- user.password = '1xedf32hgt'
- user.save # => true
- # Method to authenticate against a password
- user.authenticate('wrong_password') # => false
- user.authenticate('1xedf32hgt') # => user object
Add Comment
Please, Sign In to add comment