class ActiveModel::EachValidator
def validate(record)
+validate_each+ to determine validity therefore subclasses should
Performs validation on the supplied record. By default this will call
def validate(record) attributes.each do |attribute| value = record.read_attribute_for_validation(attribute) next if (value.nil? && options[:allow_nil]) || (value.blank? && options[:allow_blank]) value = prepare_value_for_validation(value, record, attribute) validate_each(record, attribute, value) end end