From 916f9ba40bd65c26aadd19632099568130bf4524 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Fri, 13 Oct 2017 12:44:55 +0200 Subject: [PATCH] Correctly query and order poll question answers for description block --- 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 18b9add0f..338f72cc4 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -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))