From 889ffe0b76c0f10e2f6dae5a616999f9a2aba3c9 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 29 Apr 2024 08:28:32 -0400 Subject: [PATCH] Add `Account.migrated` scope --- app/models/account.rb | 1 + app/models/relationship_filter.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/account.rb b/app/models/account.rb index 8a990bb831d..1e93330b04f 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -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) } diff --git a/app/models/relationship_filter.rb b/app/models/relationship_filter.rb index 828610e46a4..726299f52af 100644 --- a/app/models/relationship_filter.rb +++ b/app/models/relationship_filter.rb @@ -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