class MarkMapper::Plugins::Validations::AssociatedValidator

Public Instance Methods

validate_each(record, attribute, value) click to toggle source
# File lib/mark_mapper/plugins/validations.rb, line 78
def validate_each(record, attribute, value)
  if !Array.wrap(value).all? { |c| c.nil? || c.valid?(options[:context]) }
    record.errors.add(attribute, :invalid, :message => options[:message], :value => value)
  end
end