Fix order shipment references in OrderUpdater

This commit is contained in:
Kristina Lim
2019-03-08 04:07:57 +08:00
parent 380a9c561e
commit bdf4132e01

View File

@@ -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