From 561cf23dc1d83a5be4ba05c42d346e49bd7a75a3 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 13 Jan 2021 16:02:21 +0000 Subject: [PATCH] Remove #update_attributes_without_callbacks This is a hacky Spree method that's removed in Spree 2.2 See: https://github.com/spree/spree/commit/7deba6a152fd63258941a5ca89f06205a5b62cfd --- app/models/spree/order.rb | 7 ------- .../app/services/order_management/order/updater.rb | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/app/models/spree/order.rb b/app/models/spree/order.rb index 4649b5a0e6..fd55aa4777 100644 --- a/app/models/spree/order.rb +++ b/app/models/spree/order.rb @@ -766,13 +766,6 @@ module Spree address end - # Update attributes of a record in the database without callbacks, validations etc. - # This was originally an extension to ActiveRecord in Spree but only used for Spree::Order - def update_attributes_without_callbacks(attributes) - assign_attributes(attributes) - Spree::Order.where(id: id).update_all(attributes) - end - private def process_each_payment diff --git a/engines/order_management/app/services/order_management/order/updater.rb b/engines/order_management/app/services/order_management/order/updater.rb index e7cb051a4f..6ff7ef5ef6 100644 --- a/engines/order_management/app/services/order_management/order/updater.rb +++ b/engines/order_management/app/services/order_management/order/updater.rb @@ -32,7 +32,7 @@ module OrderManagement # update totals a second time in case updated adjustments have an effect on the total update_totals - order.update_attributes_without_callbacks( + order.update_columns( payment_state: order.payment_state, shipment_state: order.shipment_state, item_total: order.item_total,