I gave this a lot of thought, and I have one modification of my previous idea 
could work, that we remove "_than":

validates_greater
validates_greater_or_equal
validates_less
validates_less_or_equal

The only problem is that it maybe sounds ambiguous regarding arguments, in 
comparison to validates_greater_than and validates_less_than which are explicit.

Another idea:

validates_greater_than
validates_min[imum]
validates_less_than
validates_max[imum]

This came to mind when I saw the existing validates_min_length and 
validates_max_length validation methods.

I thought about validates_at_least and validates_at_most, and maybe one 
downside is that in english these phrases are often used in context which is 
not related to numbers and inequality. But I definitely like that it's short 
and simple.

Regards,
Janko

> On 31 Mar 2016, at 02:09, Jeremy Evans <[email protected]> wrote:
> 
> On Sunday, March 13, 2016 at 8:43:06 PM UTC-7, Janko Marohnić wrote:
> I think it would be good to have these validations, although I also 
> personally didn't need them yet. One use case I can think of is validating 
> that a number isn't negative, which IMO is a very common requirement.
> I would just suggest a slight modification to Jeremy's idea. As a person who 
> graduated mathematics, it's unintuitive for me to think of a "greater than or 
> equal" operator >= as "not less than". It's just that when I was reading 
> these two, it took me some time to figure out what do they mean, even though 
> I knew that they're either >= or <=.
> 
> I would propose that instead of "validates_not_less_than" and 
> "validates_not_greater_than", we have "validates_greater_or_equal" and 
> "validates_less_or_equal". But I wouldn't be unhappy if the first one stays. 
> Now it makes sense when I read it, it just didn't the first time.
> 
> Janko
> 
> 
> Nobody has spoken up against this, so I'm OK with a feature like this going 
> in.  I haven't really decided on method names for the >= and <= methods.  I 
> don't want validates_greater_than_or_equal or similar, it's just too long. 
> validates_greater_or_equal seems odd when you have validates_greater_than, 
> and validates_greater is odd as well. Maybe validates_at_least and 
> validates_at_most?  I'm open to other options.
> 
> Thanks,
> Jeremy 
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "sequel-talk" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/sequel-talk/EMrbjLFrJpA/unsubscribe 
> <https://groups.google.com/d/topic/sequel-talk/EMrbjLFrJpA/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/sequel-talk 
> <https://groups.google.com/group/sequel-talk>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to