diff options
author | ysksn <bluewhale1982@gmail.com> | 2020-01-11 19:55:33 +0900 |
---|---|---|
committer | Yamagishi Kazutoshi <ykzts@desire.sh> | 2020-01-11 19:55:33 +0900 |
commit | 6f8f018e3ed7811998bf2cc10d1b6f0dad54dcef (patch) | |
tree | 629b16c031d47edc15502735b1e00ab91fc5fe93 /app/models/status.rb | |
parent | c10ff359a2c4e1a24e04c80b1b9d46541efc1705 (diff) |
Refactor StatusThreadingConcern (#9626)
* Remove #filter_from_context? * Create scope Status.with_accounts Retrieving AR objects should be their model's scope
Diffstat (limited to 'app/models/status.rb')
-rw-r--r-- | app/models/status.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/status.rb b/app/models/status.rb index 670109762..1e630196b 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -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) } |