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