Skip to content

Instantly share code, notes, and snippets.

View haggen's full-sized avatar

Arthur Corenzan haggen

View GitHub Profile
@haggen
haggen / cpf_cnpj_validators.rb
Last active October 21, 2019 14:40 — forked from gouvermxt/cpf_cnpj_validators.rb
CPF and CNPJ validators Rails 3+ style
# CPF and CNPJ validators Rails 3+ style
# By Arthur Corenzan <arthur@corenzan.com>
# Based on the work of André Camargo <andre@boaideia.inf.br>
#
# Copy this file to your initializers or lib directory, then apply like this:
#
# class Person
# ...
#
# validates :cpf, :cpf => true