def validate(record)
      attributes.each do |attribute|
        value = record.read_attribute_for_validation(attribute)
        validate_each(record, attribute, value)
      end
    end
def validate(record)
      attributes.each do |attribute|
        value = record.read_attribute_for_validation(attribute)
        validate_each(record, attribute, value)
      end
    end
as of ActiveModel 4, allow_nil: true causes a change from a value back to
   nil to be allowed. prevent this.