Sha256: ce7cfbaeb5da0663001dadf6d1c18b1ee8cb35b942c715fc2220cf2381bcb6e9
Contents?: true
Size: 244 Bytes
Versions: 6
Compression:
Stored size: 244 Bytes
Contents
class CnpjValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) return if value.blank? cnpj = BrDocuments::CnpjCpf::Cnpj.new(value) record.errors.add(attribute, :invalid) unless cnpj.valid? end end
Version data entries
6 entries across 6 versions & 1 rubygems