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
This commit is contained in:
kikito
2017-01-24 18:10:13 +01:00
parent 6711063c7d
commit ddf8d5f811
2 changed files with 2 additions and 17 deletions

View File

@@ -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))