mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix validation conditional in Spree::Product
This commit is contained in:
@@ -90,7 +90,7 @@ module Spree
|
||||
|
||||
validates :supplier, presence: true
|
||||
validates :primary_taxon, presence: true
|
||||
validates :tax_category_id, presence: true, if: "Spree::Config.products_require_tax_category"
|
||||
validates :tax_category_id, presence: true, if: proc { Spree::Config[:products_require_tax_category] }
|
||||
|
||||
validates :variant_unit, presence: true
|
||||
validates :unit_value, presence: { if: ->(p) { %w(weight volume).include? p.variant_unit } }
|
||||
|
||||
Reference in New Issue
Block a user