Plugins - Validates as EU VAT Number

StarAdd to favorites

Validates whether the value of the specified attribute is in the correct form by matching it against the VAT picture for the appropriate country.

   class Person < ActiveRecord::Base
     validates_as_eu_vat_number :identifier, :with => :country_code
     validates_as_eu_vat_number :full_vat_number
   end

Configuration options:

 * <tt>message</tt> - A custom error message (default is: "is invalid")
 * <tt>with</tt> - Either a symbol referencing a field with the country code, or the code itself as a String.
 * <tt>on</tt> Specifies when this validation is active (default is :save, other options :create, :update)
 * <tt>allow_nil</tt> - Skip validation if attribute is nil.
 * <tt>allow_blank</tt> - Skip validation if attribute is blank.
 * <tt>if</tt> - Specifies a method, proc or string to call to determine if the validation should
   occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }).  The
   method, proc or string should return or evaluate to a true or false value.
 * <tt>unless</tt> - Specifies a method, proc or string to call to determine if the validation should
   not occur (e.g. :unless => :skip_validation, or :unless => Proc.new { |user| user.signup_step <= 2 }).  The
   method, proc or string should return or evaluate to a true or false value.

Neil Wilson

http://accounts4free.rubyforge.org/svn/plugins/validates_as_eu_vat_number

Rails' (MIT)

  • Currently 0.0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Model

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?