Fix Rails/WhereExists
cop in app/validators (#28854)
This commit is contained in:
parent
e2d9635074
commit
67f54c4e75
3 changed files with 2 additions and 4 deletions
|
@ -35,7 +35,7 @@ class VoteValidator < ActiveModel::Validator
|
|||
if vote.persisted?
|
||||
account_votes_on_same_poll(vote).where(choice: vote.choice).where.not(poll_votes: { id: vote }).exists?
|
||||
else
|
||||
account_votes_on_same_poll(vote).where(choice: vote.choice).exists?
|
||||
account_votes_on_same_poll(vote).exists?(choice: vote.choice)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue