From 59cab902f02e94df95750b8a1c2971d578c478d5 Mon Sep 17 00:00:00 2001 From: Andy Brett Date: Mon, 30 Nov 2020 11:07:24 -0800 Subject: [PATCH] add numericality validation --- app/models/spree/product.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/spree/product.rb b/app/models/spree/product.rb index 0f8eeab61c..697bb56030 100755 --- a/app/models/spree/product.rb +++ b/app/models/spree/product.rb @@ -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,