This commit is contained in:
KMY 2024-03-19 10:17:34 +09:00
parent b3c2e47ea8
commit 48747d0fb2
2 changed files with 2 additions and 1 deletions

View file

@ -69,7 +69,7 @@ class PublicFeed
end
def public_scope
Status.public_visibility.joins(:account).merge(Account.without_suspended.without_silenced)
Status.with_public_visibility.joins(:account).merge(Account.without_suspended.without_silenced)
end
def public_search_scope

View file

@ -138,6 +138,7 @@ class Status < ApplicationRecord
scope :with_accounts, ->(ids) { where(id: ids).includes(:account) }
scope :without_replies, -> { where('statuses.reply = FALSE OR statuses.in_reply_to_account_id = statuses.account_id') }
scope :without_reblogs, -> { where(statuses: { reblog_of_id: nil }) }
scope :with_public_visibility, -> { where(visibility: [:public, :public_unlisted, :login]) }
scope :with_public_search_visibility, -> { merge(where(visibility: [:public, :public_unlisted, :login]).or(Status.where(searchability: [:public, :public_unlisted]))) }
scope :tagged_with, ->(tag_ids) { joins(:statuses_tags).where(statuses_tags: { tag_id: tag_ids }) }
scope :not_excluded_by_account, ->(account) { where.not(account_id: account.excluded_from_timeline_account_ids) }