-
Notifications
You must be signed in to change notification settings - Fork 5.5k
How To: Upgrade to Devise 4.4.0
https://github.com/plataformatec/devise/blob/master/CHANGELOG.md
Since this changed devise's behavior significantly, we rolled these changes back, so you can update to 4.4.3 and you won't need to change your validations.
Before this version, the Trackable
module used to call #save
with validate: false
. This could cause issues during the signup: invalid users being registered. See https://github.com/plataformatec/devise/issues/4673 for more details.
After 4.4.0
, the Trackable
module does run the resource validations during sign in. If your resource is not valid during the sign in, you may have issues after updating. You can read the following issue for more information: https://github.com/plataformatec/devise/issues/4742.
The solution will be different depending on your use case, but in the end, the resource should be valid to ensure everything will work. Some of the common problems and solutions:
- If you're overriding the
#password_required?
, please review it to make sure it's not requiring a password outside signup or account update; - If your model doesn't use the
validatable
module, it's possible that you have the following validations:
validates :password, presence: true
validates :password_confirmation, presence: true
In this case, consider removing them and using the validatable
module. If that seems too much, you can also copy the #password_required?
method and use it to make these validations conditional.