Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Validator inRange rule should have an inclusive/exclusive option #84

Closed
kszucs opened this Issue · 8 comments

5 participants

@kszucs

Much comfortable than creating another rule just because it checks exclusively.

@davidpersson
Owner

So the inRange validator with options lower set to 5 and upper to 10 in exclusive mode should match 3 and 11 but not 7?

@kszucs
@davidpersson
Owner

Thanks for your explanation. I don't see a why you can't achieve this by specifying lower 6 and upper 9 when it does what you want. Seems clearer to me, wouldn't require reading about/documenting an additional feature and is more straightforward. I'm closing this for now, anybody who has a stronger feeling about implementing this can reopen the ticket.

@kszucs
@davidpersson davidpersson reopened this
@joebeeson

Couldn't the issue @threestan is seeing be resolved by instead switching the isRange validator to be inclusive all the time?

@nateabele
Owner

@threestan I don't think this is common enough to warrant patching the core. What's wrong with just adding a custom validation rule in your app?

@kszucs

Sure, I did so.
IMHO inclusive is the expected behavior

@nateabele
Owner

Finally getting caught up here. @threestan I'm fine with inclusive being the default behavior here. If you're willing to provide a patch and a test case in a PR against the dev branch, we'll get it into core.

@jails jails closed this in 356ca98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.