We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4254ae5 commit 3f15d5bCopy full SHA for 3f15d5b
1 file changed
app/validators/vote_validator.rb
@@ -6,7 +6,7 @@ def validate(vote)
6
7
if vote.poll.multiple? && vote.poll.votes.where(account: vote.account, choice: vote.choice).exists?
8
vote.errors.add(:base, I18n.t('polls.errors.already_voted'))
9
- elsif vote.poll.votes.where(account: vote.account).exists?
+ elsif !vote.poll.multiple? && vote.poll.votes.where(account: vote.account).exists?
10
11
end
12
0 commit comments