From 8e5cf50679b3fa4e819d4d3e857dc37a33e7f68a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Fri, 6 Oct 2017 12:52:13 +0200 Subject: [PATCH] Prevent user from seeing its votes in a poll after signing in --- app/helpers/polls_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/polls_helper.rb b/app/helpers/polls_helper.rb index a676084cb..c66db216f 100644 --- a/app/helpers/polls_helper.rb +++ b/app/helpers/polls_helper.rb @@ -42,7 +42,7 @@ module PollsHelper end def voted_before_sign_in(question) - current_user.current_sign_in_at >= question.poll.voters.find_by_user_id(current_user).updated_at + current_user.current_sign_in_at >= question.answers.find_or_initialize_by(author: current_user).updated_at end end