Fix Style/ReduceToHash cop (#38088)

This commit is contained in:
Matt Jankowski authored and GitHub committed 2026-03-09 10:01:12 +00:00
1 parent 3a796544e3
commit fcc3fac8a8
6 files changed
+21 -21

No files matched your search

@@ -60,7 +60,7 @@ class AccountRelationshipsPresenter
Rails.cache.write_multi(to_cache, expires_in: 1.day)
# Return formatted value
@accounts.each_with_object({}) { |account, h| h[account.id] = blocks_by_domain[account.domain] }
@accounts.to_h { |account| [account.id, blocks_by_domain[account.domain]] }
end
def cached
@@ -8,8 +8,8 @@ class TagRelationshipsPresenter
@following_map = {}
@featuring_map = {}
else
@following_map = TagFollow.select(:tag_id).where(tag_id: tags.map(&:id), account_id: current_account_id).each_with_object({}) { |f, h| h[f.tag_id] = true }.merge(options[:following_map] || {})
@featuring_map = FeaturedTag.select(:tag_id).where(tag_id: tags.map(&:id), account_id: current_account_id).each_with_object({}) { |f, h| h[f.tag_id] = true }.merge(options[:featuring_map] || {})
@following_map = TagFollow.select(:tag_id).where(tag_id: tags.map(&:id), account_id: current_account_id).to_h { |f| [f.tag_id, true] }.merge(options[:following_map] || {})
@featuring_map = FeaturedTag.select(:tag_id).where(tag_id: tags.map(&:id), account_id: current_account_id).to_h { |f| [f.tag_id, true] }.merge(options[:featuring_map] || {})
end
end
end