Weight only returned for products whose variant_unit is 'weight'

This commit is contained in:
Rob Harrington
2015-10-01 11:06:02 +10:00
parent 2d468f5022
commit a71999ba84

View File

@@ -57,7 +57,7 @@ module OpenFoodNetwork
end
def weight_from_unit_value
(unit_value || 0) / 1000
(unit_value || 0) / 1000 if self.product.variant_unit == 'weight'
end
private