Class: ValidIntValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/sift/validators/valid_int_validator.rb

Constant Summary collapse

NULL_TOKEN =
"null"

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



4
5
6
7
# File 'lib/sift/validators/valid_int_validator.rb', line 4

def validate_each(record, attribute, value)
  record.errors.add attribute, (options[:message] || "must be integer, array of integers, or range") unless
    valid_int?(value)
end