Geoffrey Roguelon
2013-Dec-23 13:23 UTC
[ActiveModel::Validations] Add an option in for the numeric validation
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: 100end by: class Person validates_numericality_of :age, in: 1..100end I've prepared an implementation for this feature. Thus, can I submit a pull request with this feature? Best regards. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscribe@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/groups/opt_out.