mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-12-30 13:45:37 +01:00
Use composable query in Status.without_replies
scope (#30086)
This commit is contained in:
parent
95e9de5777
commit
ac7f4d57bb
1 changed files with 3 additions and 1 deletions
|
@ -106,7 +106,9 @@ class Status < ApplicationRecord
|
|||
scope :remote, -> { where(local: false).where.not(uri: nil) }
|
||||
scope :local, -> { where(local: true).or(where(uri: nil)) }
|
||||
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_replies, -> { not_reply.or(reply_to_account) }
|
||||
scope :not_reply, -> { where(reply: false) }
|
||||
scope :reply_to_account, -> { where(arel_table[:in_reply_to_account_id].eq arel_table[:account_id]) }
|
||||
scope :without_reblogs, -> { where(statuses: { reblog_of_id: nil }) }
|
||||
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) }
|
||||
|
|
Loading…
Reference in a new issue