Fix various edge cases with local moves (#24812)

This commit is contained in:
Claire
2023-05-03 19:19:25 +02:00
committed by GitHub
parent 1e75eb690d
commit a2a22bad23
4 changed files with 108 additions and 32 deletions

View File

@ -33,6 +33,16 @@ class FollowMigrationService < FollowService
follow_request
end
def change_follow_options!
migrate_list_accounts!
super
end
def change_follow_request_options!
migrate_list_accounts!
super
end
def direct_follow!
follow = super
@ -45,6 +55,8 @@ class FollowMigrationService < FollowService
def migrate_list_accounts!
ListAccount.where(follow_id: @original_follow.id).includes(:list).find_each do |list_account|
list_account.list.accounts << @target_account
rescue ActiveRecord::RecordInvalid
nil
end
end
end