Most voted fix
This commit is contained in:
@@ -13,10 +13,9 @@ class Polls::QuestionsController < ApplicationController
|
|||||||
answer.touch if answer.persisted?
|
answer.touch if answer.persisted?
|
||||||
answer.save!
|
answer.save!
|
||||||
answer.record_voter_participation(token)
|
answer.record_voter_participation(token)
|
||||||
@question.question_answers
|
@question.question_answers.where(question_id: @question).each do |answer|
|
||||||
.where(question_id: @question, title: answer.answer)
|
answer.set_most_voted
|
||||||
.first
|
end
|
||||||
.set_most_voted
|
|
||||||
|
|
||||||
@answers_by_question_id = { @question.id => params[:answer] }
|
@answers_by_question_id = { @question.id => params[:answer] }
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user