nkokkos / vatNumber

An active model method to validate if a greek taxpayer's vat number is legal or not

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vatNumber old Rails Plugin

Validates greek vat number format

Installation

Installing as a Ruby on Rails plugin:

./script/plugin install http://github.com/nkokkos/validates_greek_vat_number_of.git

Usage

class Person < ActiveRecord::Base
  validates_greek_vat_number_format_of :vatnumber
end

Options

:message
   String. A custom error message (default is: " does not appear to be a valid greek vat number")
:on
   Symbol. Specifies when this validation is active (default is :save, other options :create, :update)
:allow_nil
   Boolean. Allow nil values (default is false)
:allow_blank
   Boolean. Allow blank values (default is false)
:if
   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. 
:unless
   See :if option.

Testing

Need to write testing procedures

Resources

Credits

Written by Nick Kokkos (2010)

Much credit goes to Alex Dunae for writing github.com/alexdunae/validates_email_format_of

About

An active model method to validate if a greek taxpayer's vat number is legal or not

License:MIT License


Languages

Language:Ruby 100.0%