From 964da1e6d687d973bf66adebdf8f8f44cdd6e76e Mon Sep 17 00:00:00 2001 From: kikito Date: Sun, 29 Jan 2017 22:53:32 +0100 Subject: [PATCH] Fixes rails autoloader error in development --- app/controllers/polls_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index b77ac22ea..41a038b46 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -4,6 +4,8 @@ class PollsController < ApplicationController has_filters %w{current expired incoming} + ::Poll::Answer # trigger autoload + def index @polls = @polls.send(@current_filter).includes(:geozones).sort_for_list.page(params[:page]) end @@ -12,7 +14,7 @@ class PollsController < ApplicationController @questions = @poll.questions.for_render.sort_for_list @answers_by_question_id = {} - poll_answers = Poll::Answer.by_question(@poll.question_ids).by_author(current_user.try(: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