From a28c6031a44602cb08c91ff4f6ea0c638672f903 Mon Sep 17 00:00:00 2001 From: wvengen Date: Sat, 21 Dec 2013 17:39:20 +0100 Subject: [PATCH] fix receive exception when input is set to nil --- app/controllers/orders_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 274a76c8..4c476cbe 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -171,8 +171,8 @@ class OrdersController < ApplicationController # which makes received_changed? not work anymore oa.attributes = oa_params counts[0] += 1 if oa.units_received_changed? - cunits[0] += oa.units_received * oa.article.unit_quantity unless oa.units_received.blank? + cunits[0] += oa.units_received * oa.article.unit_quantity oacounts = oa.redistribute oa.units_received * oa.price.unit_quantity, rest_to oacounts.each_with_index {|c,i| cunits[i+1]+=c; counts[i+1]+=1 if c>0 } end