Updated status model only_replies, without_replies to check reply boolean

• Updated:
- status model only_replies, without_replies to check reply boolean instead of in_reply_to_id because if a status is deleted then we don't want a comment to show as a normal status
This commit is contained in:
mgabdev 2020-08-05 23:33:39 -05:00
parent a6206bb13b
commit 0c99ac60c0
1 changed files with 2 additions and 2 deletions

View File

@ -91,8 +91,8 @@ class Status < ApplicationRecord
scope :remote, -> { where(local: false).or(where.not(uri: nil)) }
scope :local, -> { where(local: true).or(where(uri: nil)) }
scope :only_replies, -> { where('statuses.in_reply_to_id IS NOT NULL') }
scope :without_replies, -> { where('statuses.in_reply_to_id IS NULL') }
scope :only_replies, -> { where('statuses.reply IS TRUE') }
scope :without_replies, -> { where('statuses.reply IS FALSE') }
scope :without_reblogs, -> { where('statuses.reblog_of_id IS NULL') }
scope :with_public_visibility, -> { where(visibility: :public) }
scope :tagged_with, ->(tag) { joins(:statuses_tags).where(statuses_tags: { tag_id: tag }) }