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
flexa_lib-0.1.5 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.1.3 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.1.2 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.1.1 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
flexa_lib-0.1.0 lib/flexa_lib/brcpfcnpj/cnpj_validator.rb
brcpfcnpj-3.1.0 lib/brcpfcnpj/cnpj_validator.rb
brcpfcnpj-3.0.8 lib/brcpfcnpj/cnpj_validator.rb
brcpfcnpj-3.0.7 lib/brcpfcnpj/cnpj_validator.rb