From f2acf4b2c7e12e2491770542a64c0aa157d3aed3 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 27 Jul 2019 11:40:52 +0800 Subject: [PATCH] fixbug --- app/controllers/polls_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index a89544669..5aecaadb0 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -899,7 +899,7 @@ class PollsController < ApplicationController @poll_multi_questions = @poll.poll_questions.where(question_type:2).select(:id,:max_choices,:min_choices,:question_number) error_question = [] @poll_multi_questions.each do |q| - poll_user_votes = current_user.poll_votes.where(question_id:q.id)&.size + poll_user_votes = current_user.poll_votes.where(poll_question_id:q.id)&.size if q.max_choices.present? && (poll_user_votes > q.max_choices) error_messages = "第#{q.question_number}题:超过最大选项限制" elsif q.min_choices.present? && (poll_user_votes < q.min_choices)