summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatt Jankowski <matt@jankowski.online>2023-05-30 10:09:57 -0400
committerGitHub <noreply@github.com>2023-05-30 16:09:57 +0200
commit80c7de998427d6c77b95ec297b84736eeecb6861 (patch)
tree0a6890b78716f4f014c5b1e298f6be7f6084961d /lib
parentb7b96efd17bfcabad56730bdf48650fb93f34fc9 (diff)
Fix Rails/WhereExists cop in CLI (#25123)
Diffstat (limited to 'lib')
-rw-r--r--lib/mastodon/cli/email_domain_blocks.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mastodon/cli/email_domain_blocks.rb b/lib/mastodon/cli/email_domain_blocks.rb
index abbbdfe31c9..88a84ecb425 100644
--- a/lib/mastodon/cli/email_domain_blocks.rb
+++ b/lib/mastodon/cli/email_domain_blocks.rb
@@ -39,7 +39,7 @@ module Mastodon::CLI
processed = 0
domains.each do |domain|
- if EmailDomainBlock.where(domain: domain).exists?
+ if EmailDomainBlock.exists?(domain: domain)
say("#{domain} is already blocked.", :yellow)
skipped += 1
next
@@ -60,7 +60,7 @@ module Mastodon::CLI
(email_domain_block.other_domains || []).uniq.each do |hostname|
another_email_domain_block = EmailDomainBlock.new(domain: hostname, parent: email_domain_block)
- if EmailDomainBlock.where(domain: hostname).exists?
+ if EmailDomainBlock.exists?(domain: hostname)
say("#{hostname} is already blocked.", :yellow)
skipped += 1
next