diff options
author | Matt Jankowski <matt@jankowski.online> | 2023-05-30 10:09:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-30 16:09:57 +0200 |
commit | 80c7de998427d6c77b95ec297b84736eeecb6861 (patch) | |
tree | 0a6890b78716f4f014c5b1e298f6be7f6084961d /lib | |
parent | b7b96efd17bfcabad56730bdf48650fb93f34fc9 (diff) |
Fix Rails/WhereExists cop in CLI (#25123)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mastodon/cli/email_domain_blocks.rb | 4 |
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 |