2
0

Fix Rails/FindEach cop (#26886)

This commit is contained in:
Matt Jankowski
2023-11-06 10:53:29 -05:00
committed by GitHub
parent fe26f33e0a
commit 0c4e7c06dc
8 changed files with 9 additions and 9 deletions

View File

@@ -55,7 +55,7 @@ class ActivityPub::FetchFeaturedTagsCollectionService < BaseService
FeaturedTag.includes(:tag).references(:tag).where(account: @account).where.not(tag: { name: normalized_names }).delete_all
FeaturedTag.includes(:tag).references(:tag).where(account: @account, tag: { name: normalized_names }).each do |featured_tag|
FeaturedTag.includes(:tag).references(:tag).where(account: @account, tag: { name: normalized_names }).find_each do |featured_tag|
featured_tag.update(name: tags.delete(featured_tag.tag.name))
end

View File

@@ -23,7 +23,7 @@ class ActivityPub::SynchronizeFollowersService < BaseService
private
def remove_unexpected_local_followers!
@account.followers.local.where.not(id: @expected_followers.map(&:id)).each do |unexpected_follower|
@account.followers.local.where.not(id: @expected_followers.map(&:id)).reorder(nil).find_each do |unexpected_follower|
UnfollowService.new.call(unexpected_follower, @account)
end
end