Improve summing of line item totals

This commit is contained in:
Matt-Yorkley
2021-01-23 04:42:58 +00:00
parent 752d8bd5a0
commit 899552cfee

View File

@@ -52,7 +52,7 @@ module OrderManagement
end
def update_item_total
order.item_total = line_items.map(&:amount).sum
order.item_total = line_items.sum('price * quantity')
update_order_total
end