Fix hound warnings

This commit is contained in:
decabeza
2019-03-26 18:21:19 +01:00
parent eda6ea7f12
commit f47ec9d7dc
12 changed files with 203 additions and 145 deletions

View File

@@ -6,18 +6,20 @@ class PollsController < ApplicationController
load_and_authorize_resource
has_filters %w[current expired]
has_orders %w{most_voted newest oldest}, only: :show
has_orders %w[most_voted newest oldest], only: :show
::Poll::Answer # trigger autoload
def index
@polls = @polls.public_polls.send(@current_filter).includes(:geozones).sort_for_list.page(params[:page])
@polls = @polls.public_polls.send(@current_filter).includes(:geozones)
.sort_for_list.page(params[:page])
end
def show
@questions = @poll.questions.for_render.sort_for_list
@token = poll_voter_token(@poll, current_user)
@poll_questions_answers = Poll::Question::Answer.where(question: @poll.questions).where.not(description: "").order(:given_order)
@poll_questions_answers = Poll::Question::Answer.where(question: @poll.questions)
.where.not(description: "").order(:given_order)
@answers_by_question_id = {}
poll_answers = ::Poll::Answer.by_question(@poll.question_ids).by_author(current_user.try(:id))