app/models/user.rb
# This function requires bcrypt gem installed and password_digest column to be
# present. It adds following funcionality:
# -Save securely hashed password digest to the database.
# -It adds up a pair of virtual attributes: password and
# password_confirmation.
# -It adds validation if those two are present and does match.
# -It provides authenticate method that returns user if password is correct
# and false otherwise.
This function requires bcrypt gem installed and password_digest column to be
present. It adds following funcionality:
Save securely hashed password digest to the database.
It adds up a pair of virtual attributes: password and
password_confirmation.
It adds validation if those two are present and does match.
It provides authenticate method that returns user if password is correct
and false otherwise.
This function requires bcrypt gem installed and password_digest column to be present . It adds following funcionality : Save securely hashed password digest to the database . It adds up a pair of virtual attributes : password and password_confirmation . It adds validation if those two are present and does match . It provides authenticate method that returns user if password is correct and false otherwise .
def create_password_reset_digest
    self.password_reset_token = User.new_token
    update_attribute(:password_reset_token_digest,
                     User.digest(password_reset_token))
  end
def create_password_reset_digest self . password_reset_token = User . new_token update_attribute ( :password_reset_token_digest , User . digest ( password_reset_token ) ) end
This function requires bcrypt gem installed and password_digest column to be
present.
This function requires bcrypt gem installed and password_digest column to be present .