diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-07-13 12:38:22 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-08-30 05:41:03 -0500 |
commit | 635cd806c57f41430e05acf2bafbcc33a32f935d (patch) | |
tree | 1dc1f2c80c81edac946690e7cb0b66fbc541b367 | |
parent | d8a6fad2349bcdfa138dfc7e88bb6595c9c4363a (diff) |
[Future] Add distributable scope
-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 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 }) } |