Repository is archived
No commit activity in last 3 years
No release in over 3 years
VAT-ID validator based on ActiveModel::EachValidator
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Vat-Id validator

Build Status Maintainability Test Coverage

A validator for VAT-ID based on ActiveModel::EachValidator.

Installation

Add this line to your application's Gemfile:

gem 'vat_id_validator'

And then execute:

$ bundle

Or install it yourself as:

$ gem install vat_id_validator

Usage Example

Your model must respond to #errors with an instance of ActiveModel::Errors. Then include ActiveModel::Validations:

class FinancialSettings
  extend ActiveModel::Naming
  include ActiveModel::Validations

  attr_reader :errors
  attr_accessor :tax_number

  def initialize
    @errors = ActiveModel::Errors.new(self)
  end

  validates :tax_number, :vat_id => true

  # ...
end

License

This gem is available as open source under the terms of the MIT licence.

Copyright (c) 2018 Sage Group Plc. All rights reserved.