From 14aa7f1e15f4bbd0439f2dff1c6dcddd3a8131e5 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 14 Mar 2024 09:19:20 -0400 Subject: [PATCH] Use `Account.activitypub` generated scope (#28157) --- app/models/account.rb | 2 +- lib/mastodon/cli/accounts.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/account.rb b/app/models/account.rb index 0a4c0f34788..322a29248ec 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -442,7 +442,7 @@ class Account < ApplicationRecord end def inboxes - urls = reorder(nil).where(protocol: :activitypub).group(:preferred_inbox_url).pluck(Arel.sql("coalesce(nullif(accounts.shared_inbox_url, ''), accounts.inbox_url) AS preferred_inbox_url")) + urls = reorder(nil).activitypub.group(:preferred_inbox_url).pluck(Arel.sql("coalesce(nullif(accounts.shared_inbox_url, ''), accounts.inbox_url) AS preferred_inbox_url")) DeliveryFailureTracker.without_unavailable(urls) end diff --git a/lib/mastodon/cli/accounts.rb b/lib/mastodon/cli/accounts.rb index b5308e2b762..d3b7ebe5805 100644 --- a/lib/mastodon/cli/accounts.rb +++ b/lib/mastodon/cli/accounts.rb @@ -295,7 +295,7 @@ module Mastodon::CLI skip_threshold = 7.days.ago skip_domains = Concurrent::Set.new - query = Account.remote.where(protocol: :activitypub) + query = Account.remote.activitypub query = query.where(domain: domains) unless domains.empty? processed, culled = parallelize_with_progress(query.partitioned) do |account|