Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 2.81 KB

english_readme.md

File metadata and controls

57 lines (42 loc) · 2.81 KB

validates_russian

[по-русски] Gem Version Build Status Code Climate

Russian specific values validation:

For generating fake values use gem 'faker-russian'

Installation

Add to Gemfile

gem 'validates_russian'

Usage

For most of the validators you just want to add this line to your model:

validates :attribute, <validator_underscore>: true

where <validator_underscore> is an underscored, lowercase form from the validator's name (see the example section below).

class Legal < ActiveRecord::Base
  validates :kpp, kpp_format: true
end

# legal = Legal.new
# legal.kpp = '001122333'
# legal.valid? # => false
# legal.kpp = '525601001'
# legal.valid? # => true

Contributing

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