Method: Devise::Models::DatabaseAuthenticatable#password=

Defined in:
lib/devise/models/database_authenticatable.rb

#password=(new_password) ⇒ Object

Regenerates password salt and encrypted password each time password is set, and then trigger any “after_changed_password”-callbacks.



36
37
38
39
40
41
42
43
# File 'lib/devise/models/database_authenticatable.rb', line 36

def password=(new_password)
  @password = new_password

  if @password.present?
    self.password_salt = self.class.password_salt
    self.encrypted_password = password_digest(@password)
  end
end