cleans up

This commit is contained in:
rgarcia
2017-10-10 12:14:04 +02:00
parent 37cae41ee9
commit 843048a861

View File

@@ -1,6 +1,4 @@
class PollsController < ApplicationController
include CommentableActions
include PollsHelper
load_and_authorize_resource
@@ -17,13 +15,13 @@ class PollsController < ApplicationController
def show
@questions = @poll.questions.for_render.sort_for_list
@token = poll_voter_token(@poll, current_user)
@answers_by_question_id = {}
poll_answers = ::Poll::Answer.by_question(@poll.question_ids).by_author(current_user.try(:id))
poll_answers.each do |answer|
@answers_by_question_id[answer.question_id] = answer.answer
end
@commentable = @poll
@comment_tree = CommentTree.new(@commentable, params[:page], @current_order)
end