0
0
Fork 0

Use enum-generated public_visibility scope on Status (#28156)

This commit is contained in:
Matt Jankowski 2024-03-14 05:31:57 -04:00 committed by GitHub
parent 19cbadfbd6
commit 0bc17a3d48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 6 deletions

View file

@ -108,7 +108,6 @@ 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) }
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) }
scope :not_domain_blocked_by_account, ->(account) { account.excluded_from_timeline_domains.blank? ? left_outer_joins(:account) : left_outer_joins(:account).where('accounts.domain IS NULL OR accounts.domain NOT IN (?)', account.excluded_from_timeline_domains) }