Environment
- Ruby 2.6.1
- Rails 5.2.2
- Devise 4.6.1
Current behavior
It appears that PR #4261 introduced a change where encrypted_password could be set to nil even when no attempt was made to change password. The relevant comment is here #4261 (comment)
This results in user model forms that have a password field in activeadmin to break with a validation failure when the password field remains empty on submit:
ActiveRecord::NotNullViolation (PG::NotNullViolation: ERROR: null value in column "encrypted_password" violates not-null constraint
Expected behavior
No attempt should be made to set encrypted_password to nil if the password field doesn't have a value. This was the case in devise versions prior to v4.6.0.
Environment
Current behavior
It appears that PR #4261 introduced a change where
encrypted_passwordcould be set tonileven when no attempt was made to changepassword. The relevant comment is here #4261 (comment)This results in user model forms that have a password field in activeadmin to break with a validation failure when the password field remains empty on submit:
Expected behavior
No attempt should be made to set
encrypted_passwordtonilif thepasswordfield doesn't have a value. This was the case in devise versions prior to v4.6.0.