mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-23 18:52:41 +00:00
Add Status.only_polls (and without polls) scope (#35330)
This commit is contained in:
parent
a315934314
commit
4ecfbd3920
4 changed files with 26 additions and 2 deletions
|
|
@ -161,7 +161,7 @@ class AccountStatusesCleanupPolicy < ApplicationRecord
|
|||
end
|
||||
|
||||
def without_poll_scope
|
||||
Status.where(poll_id: nil)
|
||||
Status.without_polls
|
||||
end
|
||||
|
||||
def without_popular_scope
|
||||
|
|
|
|||
|
|
@ -121,6 +121,8 @@ class Status < ApplicationRecord
|
|||
scope :without_replies, -> { not_reply.or(reply_to_account) }
|
||||
scope :not_reply, -> { where(reply: false) }
|
||||
scope :only_reblogs, -> { where.not(reblog_of_id: nil) }
|
||||
scope :only_polls, -> { where.not(poll_id: nil) }
|
||||
scope :without_polls, -> { where(poll_id: nil) }
|
||||
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 }) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue