Use existing SeveredRelationship.about_local_account
scope in more places (#29673)
This commit is contained in:
parent
718ee72c80
commit
77897cd24c
5 changed files with 8 additions and 7 deletions
|
@ -48,13 +48,13 @@ module Account::Merging
|
|||
record.update_attribute(:account_warning_id, id)
|
||||
end
|
||||
|
||||
SeveredRelationship.where(local_account_id: other_account.id).reorder(nil).find_each do |record|
|
||||
SeveredRelationship.about_local_account(other_account).reorder(nil).find_each do |record|
|
||||
record.update_attribute(:local_account_id, id)
|
||||
rescue ActiveRecord::RecordNotUnique
|
||||
next
|
||||
end
|
||||
|
||||
SeveredRelationship.where(remote_account_id: other_account.id).reorder(nil).find_each do |record|
|
||||
SeveredRelationship.about_remote_account(other_account).reorder(nil).find_each do |record|
|
||||
record.update_attribute(:remote_account_id, id)
|
||||
rescue ActiveRecord::RecordNotUnique
|
||||
next
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue