Returns self if the password is correct, otherwise false.
# File lib/active_model/secure_password.rb, line 57 57: def authenticate(unencrypted_password) 58: if BCrypt::Password.new(password_digest) == unencrypted_password 59: self 60: else 61: false 62: end 63: end
Encrypts the password into the password_digest attribute.
# File lib/active_model/secure_password.rb, line 66 66: def password=(unencrypted_password) 67: @password = unencrypted_password 68: unless unencrypted_password.blank? 69: self.password_digest = BCrypt::Password.create(unencrypted_password) 70: end 71: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.