Validates as EU VAT Number plugin

Plugin details

Implements an ActiveRecord validation helper called validates_as_eu_vat_number, which will check an attribute to make sure that it confirms to the layout of a VAT number in the appropriate EU country.

Repositoryhttp://accounts4free.rubyforge.org/svn/plugins/validates_as_eu_vat_number Author Neil Wilson Tags validation LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install http://accounts4free.rubyforge.org/svn/plugins/validates_as_eu_vat_number

Install the plugin either via script/plugin

script/plugin install http://accounts4free.rubyforge.org/svn/plugins/validates_as_eu_vat_number



or via piston

cd vendor/plugins
script/plugin install http://accounts4free.rubyforge.org/svn/plugins/validates_as_eu_vat_number



Use the plugin in an ActiveRecord model as you would any other.

class Vat < ActiveRecord::Base
  validates_as_eu_vat_number :number, :with => :country_code
end



The :with option specifies the attribute that contains the EU country the vat number belongs to. If you drop the :with option the routine expects the country code to be the first two characters of the vat number.

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: Guest, 8 months ago