Sha256: a95282fa99e88b68885a869d9096b0decd938e074ee08f6f29498ff3f638dccb

Contents?: true

Size: 202 Bytes

Versions: 48

Compression:

Stored size: 202 Bytes

Contents

class CnpjValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    return if value.nil?
    record.errors.add attribute, :invalid unless Cnpj.new(value).valido?
  end
end

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
brcpfcnpj-3.3.0 lib/brcpfcnpj/cnpj_validator.rb
brcpfcnpj-3.2.0 lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.5.2 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.5.1 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.5.0 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.3.9 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.3.8 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.3.7 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.3.6 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.3.5 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.3.4 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.3.3 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.3.2 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.3.1 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.3.0 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.2.9 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.2.8 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.2.7 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.2.6 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.2.5 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb