-
Notifications
You must be signed in to change notification settings - Fork 98
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
Feature Request: validatePresenceOn #189
Comments
@jhitchins88 This seems like a phenomenal idea. Lmk if you have time for a PR! |
@jhitchins88 how did you write this validator? Don't the validators only receive the key and the value of the property that is validated? I'm very interested in this (and a similar validator where at least one of several fields must be present/have a specific format). |
@snewcomer I should be able to do it. I'll work it up into a PR soon. @nickschot I used the |
@jhitchins88 Can you add this feature as well? |
I'd need a little more description of "have a specific format", but I'd be down if we know what that looks like. If it gets too much more complicated, we should probably break this functionality into its own validator, or have some way to do conditionals in the |
@nickschot Can you please clarify this format validation of one field in another field? |
Suggested Addition
The
validatePresenceOn
validator: validate presence if other field(s) are also there.How it works
Alternatively, it could be an option for the
validatePresence
validator:This is something I wrote as a custom validator, so if it's something you would like, I can put up a PR.
The text was updated successfully, but these errors were encountered: