From a34118dbb0ec152d4675545f9d9619fab1909c6b Mon Sep 17 00:00:00 2001 From: Bertocq Date: Mon, 13 Nov 2017 02:23:49 +0100 Subject: [PATCH] Fix Lint/ShadowingOuterLocalVariable rubocop issue --- app/controllers/polls/questions_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/polls/questions_controller.rb b/app/controllers/polls/questions_controller.rb index e1fc73805..73e7fa160 100644 --- a/app/controllers/polls/questions_controller.rb +++ b/app/controllers/polls/questions_controller.rb @@ -13,8 +13,8 @@ class Polls::QuestionsController < ApplicationController answer.touch if answer.persisted? answer.save! answer.record_voter_participation(token) - @question.question_answers.where(question_id: @question).each do |answer| - answer.set_most_voted + @question.question_answers.where(question_id: @question).each do |question_answer| + question_answer.set_most_voted end @answers_by_question_id = { @question.id => params[:answer] }