diff options
-rw-r--r-- | activemodel/lib/active_model/secure_password.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activemodel/lib/active_model/secure_password.rb b/activemodel/lib/active_model/secure_password.rb index e7a57cf691..cc0dfb1860 100644 --- a/activemodel/lib/active_model/secure_password.rb +++ b/activemodel/lib/active_model/secure_password.rb @@ -62,7 +62,8 @@ module ActiveModel end end - # Encrypts the password into the password_digest attribute. + # Encrypts the password into the password_digest attribute, only if the + # new password is not blank. def password=(unencrypted_password) @password = unencrypted_password unless unencrypted_password.blank? |