Sha256: f30fe8bdf0c37a9b969b5e8f3060b03636310a092e978c66420b8da4425c2d01

Contents?: true

Size: 1.24 KB

Versions: 3

Compression:

Stored size: 1.24 KB

Contents

ico-validator [![Build Status](https://travis-ci.org/ucetnictvi-on-line/ico-validator.svg?branch=master)](https://travis-ci.org/ucetnictvi-on-line/ico-validator) [![Code Climate](https://codeclimate.com/github/ucetnictvi-on-line/ico-validator/badges/gpa.svg)](https://codeclimate.com/github/ucetnictvi-on-line/ico-validator) [![Test Coverage](https://codeclimate.com/github/ucetnictvi-on-line/ico-validator/badges/coverage.svg)](https://codeclimate.com/github/ucetnictvi-on-line/ico-validator)
=============

Rails validator for format of [Czech company identification number - ICO](http://cs.wikipedia.org/wiki/Identifika%C4%8Dn%C3%AD_%C4%8D%C3%ADslo_osoby)

## Usage
ICO validator is implemented as ActiveModel::EachValidator so for validation just add `ico: true` parameter to your attribute validation. If validation doesn't pass it adds `:invalid_format` error on validated attribute.

### Full Example
```ruby
attr_accessor :ico
validates :ico,
  ico: true

```

### What is validated

* ICO length - must be exactly 8 characters
* ICO must contain only numbers
* ICO number must satisfy [last digit control formula ](http://www.cssz.cz/cz/e-podani/pro-vyvojare/definice-druhu-e-podani/p-o/logicke-testy-datove-vety.htm)

## TODO

* Add JS validation for ICO fields

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ico-validator-0.1.1 README.md
ico-validator-0.1.0 README.md
ico-validator-0.0.1 README.md