Methods
A
P
Instance Public methods
authenticate(unencrypted_password)

Returns self if the password is correct, otherwise false.

# File activemodel/lib/active_model/secure_password.rb, line 57
def authenticate(unencrypted_password)
  if BCrypt::Password.new(password_digest) == unencrypted_password
    self
  else
    false
  end
end
password=(unencrypted_password)

Encrypts the password into the password_digest attribute.

# File activemodel/lib/active_model/secure_password.rb, line 66
def password=(unencrypted_password)
  @password = unencrypted_password
  unless unencrypted_password.blank?
    self.password_digest = BCrypt::Password.create(unencrypted_password)
  end
end