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

Disabling specific validations instead of disabling all of them? #4577

Closed
mitchellporter opened this issue Sep 28, 2016 · 2 comments
Closed
Labels
help This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary

Comments

@mitchellporter
Copy link

mitchellporter commented Sep 28, 2016

I already know that there is a way to disable validation when saving by passing in the validateBeforeSave: false option, but is there a way to disable a specific validation for a field? An example would be something like I want to validate the username, but not the password.

Is there a way to do this, or is validateBeforeSave the only option?

@vkarpov15
Copy link
Collaborator

The validateSync() function supports passing a list of fields to validate, but that's more a hack than anything. No way to do that in general with save() but you can pretty easily write custom validators that skip validation given certain criteria

@vkarpov15 vkarpov15 added the help This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary label Oct 1, 2016
@mitchellporter
Copy link
Author

Awesome thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
Projects
None yet
Development

No branches or pull requests

2 participants