0
0
Fork 0

Fix Rails/WhereExists cop in app/lib (#28862)

This commit is contained in:
Matt Jankowski 2024-01-24 06:51:09 -05:00 committed by GitHub
parent 41c2af2270
commit 1290fede65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 7 additions and 11 deletions

View file

@ -320,7 +320,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
already_voted = true
with_redis_lock("vote:#{replied_to_status.poll_id}:#{@account.id}") do
already_voted = poll.votes.where(account: @account).exists?
already_voted = poll.votes.exists?(account: @account)
poll.votes.create!(account: @account, choice: poll.options.index(@object['name']), uri: object_uri)
end
@ -406,7 +406,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
return false if local_usernames.empty?
Account.local.where(username: local_usernames).exists?
Account.local.exists?(username: local_usernames)
end
def tombstone_exists?