Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poll comments #1961

Merged
Prev Previous commit
Next Next commit
cleans up
  • Loading branch information
voodoorai2000 committed Oct 10, 2017
commit 843048a86176cbfe4b4f023a0b0debcd740add63
6 changes: 2 additions & 4 deletions app/controllers/polls_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class PollsController < ApplicationController
include CommentableActions

include PollsHelper

load_and_authorize_resource
Expand All @@ -17,13 +15,13 @@ def index
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
Expand Down