class ItalianEinvoicingCodeValidator

Constants

FORMAT

Public Instance Methods

validate_each(record, attribute, value) click to toggle source
# File lib/active_model/validations/italian_einvoicing_code_validator.rb, line 6
def validate_each(record, attribute, value)
  return if options[:allow_blank] && value.blank?

  record.errors.add(attribute, :invalid) unless value.match(FORMAT)
end