Add Account.migrated scope

This commit is contained in:
Matt Jankowski 2024-04-29 08:28:32 -04:00
parent 7d3fe2b4c3
commit eaf691b625
2 changed files with 2 additions and 1 deletions

View file

@ -122,6 +122,7 @@ class Account < ApplicationRecord
scope :silenced, -> { where.not(silenced_at: nil) }
scope :suspended, -> { where.not(suspended_at: nil) }
scope :sensitized, -> { where.not(sensitized_at: nil) }
scope :migrated, -> { where.not(moved_to_account_id: nil) }
scope :without_suspended, -> { where(suspended_at: nil) }
scope :without_silenced, -> { where(silenced_at: nil) }
scope :without_instance_actor, -> { where.not(id: INSTANCE_ACTOR_ID) }

View file

@ -92,7 +92,7 @@ class RelationshipFilter
def status_scope(value)
case value
when 'moved'
Account.where.not(moved_to_account_id: nil)
Account.migrated
when 'primary'
Account.where(moved_to_account_id: nil)
else