Sha256: 01f92866e54ef2af6e8c863cb51888f487c900e9eb9f1fb2edb62de9af001061

Contents?: true

Size: 1.41 KB

Versions: 1

Compression:

Stored size: 1.41 KB

Contents

# ValidateCpf

Para ler esta documentação em português click [aqui](https://github.com/RamonHossein/validate_cpf/blob/master/LEIAME.md).

Adds CPF validation support to Rails (ActiveModel) and test it in a simple way.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'validate_cpf'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install validate_cpf

## Usage

Just use as any other validator:

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

## Error Message

If you need to localize the error message, just add this to your I18n locale file:

```ruby
errors:
  messages:
    this_document_is_invalid: "This document is invalid"
```

You can provide your own message using :message option.

```ruby
validates :cpf, cpf: {message: "new error message"}
```

## Mantainers
[RamonHossein](https://github.com/RamonHossein)

## Contributors

To see the generous people who have contributed code, take a look at the [contributors list](http://github.com/RamonHossein/validate_cpf/contributors).

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
validate_cpf-1.0.0 README.md