Hi,
I searched any topics about the option ‘in’ for the numeric validations in the models but I found nothing. Thus, I suggest to add the ability to define the options of the validation with help of Range of Numeric values. The benefit will be the reduction of validation size in the models simplifying maintenance and reading of the code.
We could change this code:
class Person
validates_numericality_of :age, greater_than_or_equal_to: 1, less_than_or_equal_to: 100
end
by:
class Person
validates_numericality_of :age, in: 1..100
end
I’ve prepared an implementation for this feature. Thus, can I submit a pull request with this feature?
Best regards.