def validate_each(record, attr_name, value)
return if value.nil?
@validator = ::Validator::Domain.new(value)
unless @validator.valid_by_length?(options[:length])
record.errors.add(attr_name, 'domain.length''domain.length', options)
end
unless @validator.valid_by_label_length?(options[:label_length])
record.errors.add(attr_name, 'domain.label_length''domain.label_length', options)
end
return unless record.errors.blank?
unless @validator.valid_by_regexp?
record.errors.add(attr_name, 'domain.invalid''domain.invalid', options)
end
end