Adding equal to greater than, equal to less than form validators. #1009

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@NickBusey
Contributor

I think this is very useful.

I have seen some say this feature is unnecessary as you can just decrement the number in question. In other words, to make sure it's equal to or greater than 0, make the number -1.

This causes two problems, first and most importantly it's broken. -.5 would be valid in this case, which is clearly NOT equal to or greater than 0.

Also, the error messaging is ugly. "The amount field must contain a number greater than -1" looks unprofessional and hacky, whereas "The amount field must contain a number equal to or greater than 0." is far nicer and easier to understand.

@seejohnrun
Contributor

I definitely think this belongs in CI, thanks for the great description.
I wonder if greater_than_equal_to is a better name - any reason you chose this way?

@NickBusey
Contributor

No reason at all, I actually prefer your naming convention.

I've renamed the functions and modified the pull request.

@seejohnrun
Contributor

I'd like to see the documentation cleaned up to something like:
http://hastebin.com/lowemukile.diff

@NickBusey
Contributor

Done

@narfbg
Contributor
narfbg commented Oct 22, 2012

Already implemented.

@narfbg narfbg closed this Oct 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment