Sha256: 2050ebddb85f9fe256db190351779b6630cf9d0b06f5587c86a49357ffbf2a66

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

= ValidatesCPF {<img src="https://secure.travis-ci.org/plribeiro3000/validates_cpf.png" />}[http://travis-ci.org/plribeiro3000/validates_cpf]

Rails gem to validate CPF. Don't forget to check {ValidatesCnpj}[https://github.com/plribeiro3000/validates_cnpj], {ValidatesTelephone}[https://github.com/plribeiro3000/validates_telephone] and {ValidatesHost}[https://github.com/plribeiro3000/validates_host].

== Install

gem install validates_cpf

== Usage

Lets say you have a model with "cpf" string column that you want to be a valid CPF. Just add this to your model:

```ruby
class User < ActiveRecord::Base
    validates :cpf, :cpf => true
end
```

== Test

This gem has buitin matchers for shoulda-matchers and remarkable.

=== How?

You should use require_a_valid_cpf(:attribute) or skip the attribute part if the attribute name is cpf.

== Goal

This project is based on brcpfcnpj gem and his intention it to mantain a cleaner code to validate CPF and easy matchers to test it.

== Contribute

Fork the project and send me a Pull Request. =D

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
validates_cpf-1.0.0 README.rdoc