From 635cd806c57f41430e05acf2bafbcc33a32f935d Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Mon, 13 Jul 2020 12:38:22 -0500 Subject: [Future] Add distributable scope --- app/models/status.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/models/status.rb b/app/models/status.rb index 02f48621a..42d5dd9ae 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -94,6 +94,7 @@ class Status < ApplicationRecord 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) } + scope :distributable, -> { where(visibility: [:public, :unlisted]) } scope :tagged_with, ->(tag) { joins(:statuses_tags).where(statuses_tags: { tag_id: tag }) } scope :excluding_silenced_accounts, -> { left_outer_joins(:account).where(accounts: { silenced_at: nil }) } scope :including_silenced_accounts, -> { left_outer_joins(:account).where.not(accounts: { silenced_at: nil }) } -- cgit