1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Add Account.migrated scope

This commit is contained in:
Matt Jankowski 2024-04-29 08:28:32 -04:00
parent 2ed13071ef
commit 3a29eebba9
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 :silenced, -> { where.not(silenced_at: nil) }
scope :suspended, -> { where.not(suspended_at: nil) } scope :suspended, -> { where.not(suspended_at: nil) }
scope :sensitized, -> { where.not(sensitized_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_suspended, -> { where(suspended_at: nil) }
scope :without_silenced, -> { where(silenced_at: nil) } scope :without_silenced, -> { where(silenced_at: nil) }
scope :without_instance_actor, -> { where.not(id: INSTANCE_ACTOR_ID) } scope :without_instance_actor, -> { where.not(id: INSTANCE_ACTOR_ID) }

View file

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