Class: ValidIntValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- ValidIntValidator
- Defined in:
- lib/brita/validators/valid_int_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
2 3 4 5 |
# File 'lib/brita/validators/valid_int_validator.rb', line 2 def validate_each(record, attribute, value) record.errors.add attribute, ([:message] || "must be integer, array of integers, or range") unless valid_int?(value) end |