Sha256: 568f32e108c248a82ec28cb58aa4ea63f75f0592c4db65bb876876e859f8d385
Contents?: true
Size: 202 Bytes
Versions: 2
Compression:
Stored size: 202 Bytes
Contents
class CnpjValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) record.errors.add(attribute, :invalid, options) unless ValidatesCnpj::Cnpj.new(value).valid? end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
validates_cnpj-2.0.1 | lib/validates_cnpj/cnpj_validator.rb |
validates_cnpj-2.0.0 | lib/cnpj_validator.rb |