From ddf8d5f811d608d87ea7f0d35a4b58d4797ab638 Mon Sep 17 00:00:00 2001 From: kikito Date: Tue, 24 Jan 2017 18:10:13 +0100 Subject: [PATCH] Removes answerable/non_answerable questions in polls Now they are either all answerable or non-answerable, so it is not worth it to make the distinction in code --- app/controllers/polls_controller.rb | 3 +-- app/views/polls/show.html.erb | 16 +--------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index 9c83bc3e3..a93c84e9d 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -9,8 +9,7 @@ class PollsController < ApplicationController end def show - @answerable_questions = @poll.questions.answerable_by(current_user).for_render.sort_for_list - @non_answerable_questions = @poll.questions.where.not(id: @answerable_questions.map(&:id)).for_render.sort_for_list + @questions = @poll.questions.for_render.sort_for_list @answers_by_question_id = {} poll_partial_results = Poll::PartialResult.by_question(@poll.question_ids).by_author(current_user.try(:id)) diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index 5270e746d..c5613e580 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -35,21 +35,7 @@
- <% @answerable_questions.each do |question| %> - <%= render 'polls/questions/question', question: question %> - <% end %> - - <% if can?(:answer, @poll) && - @non_answerable_questions.present? %> -
-

- <%= t("polls.show.cant_answer_wrong_geozone", - count: @non_answerable_questions.count) %> -

-
- <% end %> - - <% @non_answerable_questions.each do |question| %> + <% @questions.each do |question| %> <%= render 'polls/questions/question', question: question %> <% end %>