app/models/user.rb
def encrypt_plaintext_password_if_supplied
    if password.present?
      self.salt = self.class.generate_hash
      self.crypted_password = encrypt_plaintext_password
    end
  end
# If a plain text password is set in the model, then update the encrypted
# password to match.
If a plain text password is set in the model, then update the encrypted
password to match.
If a plain text password is set in the model then update the encrypted password to match .
def encrypt_plaintext_password_if_supplied
    if password.present?
      self.salt = self.class.generate_hash
      self.crypted_password = encrypt_plaintext_password
    end
  end
def encrypt_plaintext_password_if_supplied if password . present? self . salt = self . class . generate_hash self . crypted_password = encrypt_plaintext_password end end
If a plain text password is set in the model, then update the encrypted
password to match.
If a plain text password is set in the model then update the encrypted password to match .