class ArrayValidator

Constants

I18N_SCOPE
VALIDATORS

Public Instance Methods

validate_each(record, attribute, values) click to toggle source
# File lib/array_validator.rb, line 14
def validate_each(record, attribute, values)
  unless values.is_a? Array
    record.errors[attribute] << (options[:message] || 'is not an array')
    return
  end

  VALIDATORS.each do |validator|
    validator.call(record, attribute, values, options)
  end
end