From bdf4132e0175846fe274d3eb2c2b6938cbfe00ca Mon Sep 17 00:00:00 2001 From: Kristina Lim Date: Fri, 8 Mar 2019 04:07:57 +0800 Subject: [PATCH] Fix order shipment references in OrderUpdater --- app/models/order_updater.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/models/order_updater.rb b/app/models/order_updater.rb index a38270f988..20141bde0c 100644 --- a/app/models/order_updater.rb +++ b/app/models/order_updater.rb @@ -84,11 +84,8 @@ class OrderUpdater < SimpleDelegator # shipments using a shipping method that doesn't require address, such us # a pickup. def shipping_address_from_distributor - shipments.each do |shipment| - shipping_method = shipment.shipping_method - next if shipping_method.require_ship_address + return if order.shipping_method.blank? || order.shipping_method.require_ship_address - order.ship_address = order.distributor.address - end + order.ship_address = order.__send__(:address_from_distributor) end end