Fix Rails/WhereExists
cop in app/services (#28853)
This commit is contained in:
parent
78ee1453f9
commit
ceade78182
3 changed files with 2 additions and 4 deletions
|
@ -19,7 +19,7 @@ class VoteService < BaseService
|
|||
already_voted = true
|
||||
|
||||
with_redis_lock("vote:#{@poll.id}:#{@account.id}") do
|
||||
already_voted = @poll.votes.where(account: @account).exists?
|
||||
already_voted = @poll.votes.exists?(account: @account)
|
||||
|
||||
ApplicationRecord.transaction do
|
||||
@choices.each do |choice|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue