From 1de68d091a35a12371c7f57bafd3bbb651fc36dd Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sat, 10 Apr 2021 18:42:07 +0100 Subject: [PATCH] Update guard clause in line item callbacks (take two) The `changed?` method is more accurately replaced by `saved_changes.present?` In some cases here (where the object had just been saved for the first time) the guard clause was still stopping execution unexpectedly. --- app/models/spree/line_item.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/spree/line_item.rb b/app/models/spree/line_item.rb index 6b17d87ca1..61bed0c1d0 100644 --- a/app/models/spree/line_item.rb +++ b/app/models/spree/line_item.rb @@ -226,7 +226,7 @@ module Spree end def update_order - return unless saved_change_to_quantity? || destroyed? + return unless saved_changes.present? || destroyed? # update the order totals, etc. order.create_tax_charge!