]> cat aescling's git repositories - mastodon.git/commitdiff
Fix "tootctl accounts fix-duplicates" (#15373)
authorThibG <thib@sitedethib.com>
Sat, 19 Dec 2020 12:34:16 +0000 (13:34 +0100)
committerGitHub <noreply@github.com>
Sat, 19 Dec 2020 12:34:16 +0000 (13:34 +0100)
- `pluck_each` cannot be used this way with `group`
- typo

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
lib/mastodon/accounts_cli.rb

index 47464386977d350743f1ccf8100283cb31ed0ba8..5275f04cf671ccbaf4b091d28839e0556fae8987 100644 (file)
@@ -245,10 +245,10 @@ module Mastodon
       domain configuration.
     LONG_DESC
     def fix_duplicates
-      Account.remote.select(:uri, 'count(*)').group(:uri).having('count(*) > 1').pluck_each(:uri) do |uri|
+      Account.remote.select(:uri, 'count(*)').group(:uri).having('count(*) > 1').pluck(:uri).each do |uri|
         say("Duplicates found for #{uri}")
         begin
-          ActivityPub::FetchRemotAccountService.new.call(uri) unless options[:dry_run]
+          ActivityPub::FetchRemoteAccountService.new.call(uri) unless options[:dry_run]
         rescue => e
           say("Error processing #{uri}: #{e}", :red)
         end