Class: ArrayValidator
- Inherits:
-
ActiveModel::EachValidator
- Object
- ActiveModel::EachValidator
- ArrayValidator
- Defined in:
- lib/mv/core/validators/array_validator.rb
Instance Method Summary collapse
Instance Method Details
#validate_each(record, attribute, value) ⇒ Object
2 3 4 |
# File 'lib/mv/core/validators/array_validator.rb', line 2 def validate_each(record, attribute, value) record.errors.add(:attribute, 'must support conversion to Array (respond to :to_a method)') unless value.respond_to?(:to_a) end |