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)