From 5e6801f6d71bfcdf249a6f0c6d9f93f167bb390b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 12 May 2022 16:36:11 +0200 Subject: [PATCH] Fix empty votes arbitrarily increasing voters count in polls --- app/services/vote_service.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/services/vote_service.rb b/app/services/vote_service.rb index 19e453332..438cb1f9b 100644 --- a/app/services/vote_service.rb +++ b/app/services/vote_service.rb @@ -5,6 +5,8 @@ class VoteService < BaseService include Payloadable def call(account, poll, choices) + return if choices.empty? + authorize_with account, poll, :vote? @account = account