Remove Order #refresh_shipment_rates method

This commit is contained in:
Matt-Yorkley
2023-06-05 19:59:09 +01:00
parent 1a7d70772a
commit a62e51c0d0
4 changed files with 3 additions and 7 deletions

View File

@@ -492,10 +492,6 @@ module Spree
end
end
def refresh_shipment_rates
shipments.map(&:refresh_rates)
end
# After changing line items of a completed order
def update_shipping_fees!
shipments.each do |shipment|

View File

@@ -377,7 +377,7 @@ describe Admin::BulkLineItemsController, type: :controller do
line_item1.product.update_columns(tax_category_id: tax_cat5.id)
line_item2.product.update_columns(tax_category_id: tax_cat10.id)
order.refresh_shipment_rates
order.shipments.map(&:refresh_rates)
order.select_shipping_method(shipping_method.id)
order.finalize!
order.recreate_all_fees!

View File

@@ -76,7 +76,7 @@ FactoryBot.define do
distributor { create(:distributor_enterprise) }
after(:create, &:refresh_shipment_rates)
after(:create) { |order, _evaluator| order.shipments.map(&:refresh_rates) }
factory :order_ready_to_ship do
payment_state { 'paid' }

View File

@@ -120,7 +120,7 @@ describe "Order Management" do
before do
order.shipment.shipping_method.calculator.update(preferred_amount: 5.0)
order.refresh_shipment_rates
order.shipments.map(&:refresh_rates)
order.save
order.reload