-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add is:
parameter to the length
validator
#2485
Add is:
parameter to the length
validator
#2485
Conversation
81c9762
to
293bd86
Compare
I like it. I think we may want to call this |
For me, |
…h-exact-validator Conflicts: CHANGELOG.md
Is Stepping back, I think
|
Not sure I understand the 1st question. If I can add my two cents, I would prefer to split into distinct length validators. |
I think it's pretty easy to grok Note that we did add |
Rails's Length Validator uses requires :code, type: String, length: { is: 2 } Suggestion: having requires :code, type: String, length: { in: 5..10 } |
I'd be good with
For large ranges doesn't that explode them causing potentially other problems? But otherwise we could support it along with I think @Dakad is looking for some consensus. What's your strong opinion @ericproulx? |
About the range, Ruby will manage its within a |
Change done! |
exact:
parameter to the length
validatoris:
parameter to the length
validator
To be or not to be, that is the question. I'm good with this, thanks for hanging in here with us @Dakad. Maybe you want to take the range idea on :) |
This PR is to complement the
length
validator introduced in #2437.It adds an
exact:
param to verify that the given param is exactly equal to a limit.