class FormObjects::AssociatedValidator

Public Instance Methods

validate_each(record, attribute, value) click to toggle source
# File lib/form_objects/associated_validator.rb, line 3
def validate_each(record, attribute, value)
  if Array[value].flatten.reject { |r| r.valid? }.any?
    record.errors.add(attribute, :invalid, options.merge(:value => value))
  end
end