Refactor StatusThreadingConcern (#9626)
* Remove #filter_from_context? * Create scope Status.with_accounts Retrieving AR objects should be their model's scope
This commit is contained in:
committed by
Yamagishi Kazutoshi
parent
c10ff359a2
commit
6f8f018e3e
@ -83,6 +83,7 @@ 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_reblogs, -> { where('statuses.reblog_of_id IS NULL') }
|
||||
scope :with_public_visibility, -> { where(visibility: :public) }
|
||||
|
Reference in New Issue
Block a user