Fix hound warnings
This commit is contained in:
@@ -8,11 +8,12 @@ class Management::ProposalsController < Management::BaseController
|
||||
before_action :load_categories, only: [:new, :edit]
|
||||
before_action :load_geozones, only: [:edit]
|
||||
|
||||
has_orders %w{confidence_score hot_score created_at most_commented random}, only: [:index, :print]
|
||||
has_orders %w{most_voted newest}, only: :show
|
||||
has_orders %w[confidence_score hot_score created_at most_commented random], only: [:index, :print]
|
||||
has_orders %w[most_voted newest], only: :show
|
||||
|
||||
def create
|
||||
@resource = resource_model.new(strong_params.merge(author: current_user, published_at: Time.now))
|
||||
@resource = resource_model.new(strong_params.merge(author: current_user,
|
||||
published_at: Time.now))
|
||||
|
||||
if @resource.save
|
||||
track_event
|
||||
@@ -51,8 +52,9 @@ class Management::ProposalsController < Management::BaseController
|
||||
end
|
||||
|
||||
def proposal_params
|
||||
params.require(:proposal).permit(:title, :question, :summary, :description, :external_url, :video_url,
|
||||
:responsible_name, :tag_list, :terms_of_service, :geozone_id, :skip_map,
|
||||
params.require(:proposal).permit(:title, :question, :summary, :description, :external_url,
|
||||
:video_url, :responsible_name, :tag_list, :terms_of_service,
|
||||
:geozone_id, :skip_map,
|
||||
map_location_attributes: [:latitude, :longitude, :zoom])
|
||||
end
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user