Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'validate' hooks aren't called when updating a model #1

Closed
miguelcoba opened this issue Sep 24, 2013 · 1 comment
Closed

'validate' hooks aren't called when updating a model #1

miguelcoba opened this issue Sep 24, 2013 · 1 comment

Comments

@miguelcoba
Copy link
Contributor

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.

@christiansmith
Copy link
Member

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants