From 858a2cf569daaa1046b9509e8760bb58345715cf Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Thu, 8 Feb 2024 11:11:14 +0100 Subject: [PATCH] Disable Rubocop self assign check in order state machine Cherry Picked from bc3944d93a9eb621f3203dcae4ad2bf2a0d10514 Co-Authored-By: Elia Schito --- core/lib/spree/core/state_machines/order.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/lib/spree/core/state_machines/order.rb b/core/lib/spree/core/state_machines/order.rb index db1faf5e3c5..058419d333f 100644 --- a/core/lib/spree/core/state_machines/order.rb +++ b/core/lib/spree/core/state_machines/order.rb @@ -46,7 +46,11 @@ def define_state_machine! # Persist the state on the order after_transition do |order, transition| - order.state = order.state + # Hard to say if this is really necessary, it was introduced in this commit: + # https://github.com/mamhoff/solidus/commit/fa1d66c42e4c04ee7cd1c20d87e4cdb74a226d3d + # But it seems to be harmless, so we'll keep it for now. + order.state = order.state # rubocop:disable Lint/SelfAssignment + order.state_changes.create( previous_state: transition.from, next_state: transition.to,