Merge pull request #10099 from tchak/fix-apply-diff

fix(apply_diff): one more time
This commit is contained in:
mfo 2024-03-11 15:35:20 +01:00 committed by GitHub
commit 847d4d4c9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -170,9 +170,7 @@ module DossierCloneConcern
children_champs_to_remove, root_champs_to_remove = champs_to_remove.partition(&:child?) children_champs_to_remove, root_champs_to_remove = champs_to_remove.partition(&:child?)
children_champs_to_remove.each(&:destroy!) children_champs_to_remove.each(&:destroy!)
root_champs_to_remove.each do |champ| Champ.where(parent_id: root_champs_to_remove.map(&:id)).destroy_all
champ.rows.flatten.each(&:destroy!) if champ.repetition? root_champs_to_remove.each(&:destroy!)
champ.destroy!
end
end end
end end