Expand search range

This commit is contained in:
KMY 2023-04-05 13:55:37 +09:00
parent 462c6e99b6
commit 08e5d96a4a
4 changed files with 10 additions and 2 deletions

View file

@ -150,12 +150,14 @@ class Status < ApplicationRecord
if preloaded.nil?
ids += mentions.joins(:account).merge(Account.local).active.pluck(:account_id)
ids += favourites.joins(:account).merge(Account.local).pluck(:account_id)
ids += emoji_reactions.joins(:account).merge(Account.local).pluck(:account_id)
ids += reblogs.joins(:account).merge(Account.local).pluck(:account_id)
ids += bookmarks.joins(:account).merge(Account.local).pluck(:account_id)
ids += poll.votes.joins(:account).merge(Account.local).pluck(:account_id) if poll.present?
else
ids += preloaded.mentions[id] || []
ids += preloaded.favourites[id] || []
ids += preloaded.emoji_reactions[id] || []
ids += preloaded.reblogs[id] || []
ids += preloaded.bookmarks[id] || []
ids += preloaded.votes[id] || []