Correctly query and order poll question answers for description block

This commit is contained in:
Bertocq
2017-10-13 12:44:55 +02:00
parent ecf95c4ea3
commit 916f9ba40b

View File

@@ -15,7 +15,7 @@ class PollsController < ApplicationController
def show
@questions = @poll.questions.for_render.sort_for_list
@token = poll_voter_token(@poll, current_user)
@poll_questions_answers = Poll::Question::Answer.where(question: @poll.questions)
@poll_questions_answers = Poll::Question::Answer.where(question: @poll.questions).where.not(description: "").order(:given_order)
@answers_by_question_id = {}
poll_answers = ::Poll::Answer.by_question(@poll.question_ids).by_author(current_user.try(:id))