You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The 'validate' hooks are not being executed when updating a model.
If some bussiness rule is enforced on creation of a new model, almost surely they will need to be enforced on updating the model.
For example, for a User model, the salt and hash are generated from the password attribute. When updating a User, if the password is changed a new salt and hash should be generated. Also, if the password isn't present when updating, the validate hook could detect it.
Way to fix it:
Apply validate hooks on update.
The text was updated successfully, but these errors were encountered:
The 'validate' hooks are not being executed when updating a model.
If some bussiness rule is enforced on creation of a new model, almost surely they will need to be enforced on updating the model.
For example, for a User model, the salt and hash are generated from the password attribute. When updating a User, if the password is changed a new salt and hash should be generated. Also, if the password isn't present when updating, the validate hook could detect it.
Way to fix it:
Apply validate hooks on update.
The text was updated successfully, but these errors were encountered: