From 5a81c86e7a1e3589fcd020e85ceeeae0fb26097b Mon Sep 17 00:00:00 2001 From: Caio <117518+caiosba@users.noreply.github.com> Date: Sun, 24 Nov 2024 10:09:18 -0300 Subject: [PATCH] Ticket CV2-5653 [WIP]: Applying PR review --- ...0241123001206_add_unique_index_to_relationships_table.rb | 6 +++--- .../20230216030351_delete_duplicate_relationships.rake | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/db/migrate/20241123001206_add_unique_index_to_relationships_table.rb b/db/migrate/20241123001206_add_unique_index_to_relationships_table.rb index 28e170005..e8e83818c 100644 --- a/db/migrate/20241123001206_add_unique_index_to_relationships_table.rb +++ b/db/migrate/20241123001206_add_unique_index_to_relationships_table.rb @@ -16,10 +16,10 @@ def change raise "No relationship to keep for target_id #{pm_id}!" if keep.nil? relationships.each do |relationship| if relationship.id == keep.id - puts " Keeping relationship ##{r.id}" + puts " Keeping relationship ##{relationship.id}" else - puts " Deleting relationship ##{r.id}" - relationship.destroy! + puts " Deleting relationship ##{relationship.id}" + relationship.delete end relationship.source.clear_cached_fields relationship.target.clear_cached_fields diff --git a/lib/tasks/migrate/20230216030351_delete_duplicate_relationships.rake b/lib/tasks/migrate/20230216030351_delete_duplicate_relationships.rake index 593a2ff2d..0f733ab03 100644 --- a/lib/tasks/migrate/20230216030351_delete_duplicate_relationships.rake +++ b/lib/tasks/migrate/20230216030351_delete_duplicate_relationships.rake @@ -14,10 +14,10 @@ namespace :check do raise "No relationship to keep for target_id #{pm_id}!" if keep.nil? relationships.each do |relationship| if relationship.id == keep.id - puts " Keeping relationship ##{r.id}" + puts " Keeping relationship ##{relationship.id}" else - puts " Deleting relationship ##{r.id}" - relationship.destroy! + puts " Deleting relationship ##{relationship.id}" + relationship.delete end relationship.source.clear_cached_fields relationship.target.clear_cached_fields