From e7810444dfe771f1c4a0e80a05f183e81cc88f0b Mon Sep 17 00:00:00 2001 From: Martin Meyerhoff Date: Wed, 18 Nov 2015 22:44:36 +0100 Subject: [PATCH] Remove default tax zone validation With the new VAT taxation system, a default zone is no longer mandatory. It is perfectly valid to have taxes that are included in price only for specific foreign zones. --- core/app/models/spree/tax_rate.rb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/core/app/models/spree/tax_rate.rb b/core/app/models/spree/tax_rate.rb index 88118f0c9a7..9d8f8e54bda 100644 --- a/core/app/models/spree/tax_rate.rb +++ b/core/app/models/spree/tax_rate.rb @@ -1,13 +1,3 @@ -module Spree - class DefaultTaxZoneValidator < ActiveModel::Validator - def validate(record) - if record.included_in_price - record.errors.add(:included_in_price, Spree.t(:included_price_validation)) unless Zone.default_tax - end - end - end -end - module Spree class TaxRate < Spree::Base acts_as_paranoid @@ -25,7 +15,6 @@ class TaxRate < Spree::Base validates :amount, presence: true, numericality: true validates :tax_category_id, presence: true - validates_with DefaultTaxZoneValidator scope :by_zone, ->(zone) { where(zone_id: zone) }