mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-10 03:30:22 +00:00
add numericality validation
This commit is contained in:
@@ -96,6 +96,7 @@ module Spree
|
||||
|
||||
validates :variant_unit, presence: true
|
||||
validates :unit_value, presence: true
|
||||
validates :unit_value, numericality: true
|
||||
validates :variant_unit_scale,
|
||||
presence: { if: ->(p) { %w(weight volume).include? p.variant_unit } }
|
||||
validates :variant_unit_name,
|
||||
|
||||
Reference in New Issue
Block a user