Merge pull request #11731 from chahmedejaz/bugfix/11667-clone-tags-issue-for-OC

Fix Cloning Tags Issue for OrderCycle
This commit is contained in:
Filipe
2023-11-17 10:50:33 +00:00
committed by GitHub
2 changed files with 2 additions and 1 deletions

View File

@@ -90,6 +90,7 @@ class Exchange < ApplicationRecord
exchange = dup
exchange.order_cycle = new_order_cycle
exchange.enterprise_fee_ids = enterprise_fee_ids
exchange.tag_list = tag_list
exchange.save!
clone_all_exchange_variants(exchange.id)
exchange

View File

@@ -275,7 +275,7 @@ describe Exchange do
ex1 = oc.exchanges.last
ex1.update_attribute(:tag_list, "wholesale")
ex2 = ex1.clone! new_oc
ex2 = ex1.reload.clone! new_oc
expect(ex1.sender_id).to eq ex2.sender_id
expect(ex1.receiver_id).to eq ex2.receiver_id