mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Make validator work in rails 5 and rails 5.2 by adding a proc
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