about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-03-12 08:33:11 +0100
committerGitHub <noreply@github.com>2022-03-12 08:33:11 +0100
commit642528f45513acb823a7291f32fb07377bd2b621 (patch)
treed4cb7bacf88eb19a23fc0feb3a2b605def026212 /app/models
parentee8d4dd056e883fdfb955e6305e68390a032ac0d (diff)
Update fix-duplicates maintenance task (#17731)
* Update fix-duplicates task to 2022_02_10_153119

Also add support for Appeal to AccountMerging#merge_with!

* Update fix-duplicates task to 2022_03_07_094650

* Update fix-duplicates task to 2022_03_09_213005

* Update fix-duplicates task to 2022_03_07_083603

* Update fix-duplicates task to 2022_03_10_060626

* Update fix-duplicates script to 2022_03_07_083603

* Update fix-duplicates task to 2022_03_10_060706

* Update fix-duplicates task to 2022_03_10_060959

* Silence CodeClimate
Diffstat (limited to 'app/models')
-rw-r--r--app/models/concerns/account_merging.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/concerns/account_merging.rb b/app/models/concerns/account_merging.rb
index 119773e6b..8161761fb 100644
--- a/app/models/concerns/account_merging.rb
+++ b/app/models/concerns/account_merging.rb
@@ -15,7 +15,8 @@ module AccountMerging
       Status, StatusPin, MediaAttachment, Poll, Report, Tombstone, Favourite,
       Follow, FollowRequest, Block, Mute,
       AccountModerationNote, AccountPin, AccountStat, ListAccount,
-      PollVote, Mention, AccountDeletionRequest, AccountNote, FollowRecommendationSuppression
+      PollVote, Mention, AccountDeletionRequest, AccountNote, FollowRecommendationSuppression,
+      Appeal
     ]
 
     owned_classes.each do |klass|
@@ -47,6 +48,10 @@ module AccountMerging
       record.update_attribute(:reference_account_id, id)
     end
 
+    Appeal.where(account_warning_id: other_account.id).find_each do |record|
+      record.update_attribute(:account_warning_id, id)
+    end
+
     # Some follow relationships have moved, so the cache is stale
     Rails.cache.delete_matched("followers_hash:#{id}:*")
     Rails.cache.delete_matched("relationships:#{id}:*")