Merge branch 'master' into mlucena-poll-comments
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
class PollsController < ApplicationController
|
||||
include CommentableActions
|
||||
|
||||
include PollsHelper
|
||||
|
||||
load_and_authorize_resource
|
||||
|
||||
has_filters %w{current expired incoming}
|
||||
@@ -14,15 +16,16 @@ class PollsController < ApplicationController
|
||||
|
||||
def show
|
||||
@questions = @poll.questions.for_render.sort_for_list
|
||||
|
||||
@commentable = @poll
|
||||
@comment_tree = CommentTree.new(@commentable, params[:page], @current_order)
|
||||
|
||||
@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
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user