No release in over 3 years
Low commit activity in last 3 years
Rails 3 validators for common numbers like PESEL, NIP, REGON
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

COMMON NUMBERS RAILS

This gem is wrapper on common_numbers library that validates such numbers as:

  • NIP (Polish Tax Identification Number)
  • PESEL (Polish ID Number)
  • REGON (Polish Company Identification Number)

in the future:

  • VIN
  • EAN
  • IBAN

###Instalation

In your Gemfile add:

gem 'common_numbers_rails'

###Example:

For standalone model use common_numbers library

For ActiveRecord Models:

class Item < ActiveRecord::Base
  validates :nip, :nip => true
  validates :pesel, :pesel => true
  validates :regon, :regon => true
end

You can also use helpers:

class Item < ActiveRecord::Base
  validates_pesel_of :pesel_field
  validates_pesel_of :pesel_field, :message => "Our custom message"
end

###TODO:

  • validators for other numbers

Copyright (c) 2011 Mariusz NosiƄski, released under the MIT license