fix(apply_diff): one more time

This commit is contained in:
Paul Chavard 2024-03-11 15:13:56 +01:00
parent d9b6db8ebc
commit a865e00f4d

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.each(&:destroy!)
root_champs_to_remove.each do |champ|
champ.rows.flatten.each(&:destroy!) if champ.repetition?
champ.destroy!
end
Champ.where(parent_id: root_champs_to_remove.map(&:id)).destroy_all
root_champs_to_remove.each(&:destroy!)
end
end