Fix more hound warnings

This commit is contained in:
decabeza
2019-03-27 15:22:14 +01:00
parent e5bff01027
commit 91be3cf775
54 changed files with 776 additions and 476 deletions

View File

@@ -17,7 +17,7 @@ class ProposalsController < ApplicationController
invisible_captcha only: [:create, :update], honeypot: :subtitle
has_orders ->(c) { Proposal.proposals_orders(c.current_user) }, only: :index
has_orders %w{most_voted newest oldest}, only: :show
has_orders %w[most_voted newest oldest], only: :show
load_and_authorize_resource
helper_method :resource_model, :resource_name
@@ -27,9 +27,12 @@ class ProposalsController < ApplicationController
super
@notifications = @proposal.notifications
@notifications = @proposal.notifications.not_moderated
@related_contents = Kaminari.paginate_array(@proposal.relationed_contents).page(params[:page]).per(5)
@related_contents = Kaminari.paginate_array(@proposal.relationed_contents)
.page(params[:page]).per(5)
redirect_to proposal_path(@proposal), status: :moved_permanently if request.path != proposal_path(@proposal)
if request.path != proposal_path(@proposal)
redirect_to proposal_path(@proposal), status: :moved_permanently
end
end
def create
@@ -87,16 +90,17 @@ class ProposalsController < ApplicationController
def publish
@proposal.publish
redirect_to share_proposal_path(@proposal), notice: t('proposals.notice.published')
redirect_to share_proposal_path(@proposal), notice: t("proposals.notice.published")
end
private
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,
image_attributes: image_attributes,
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy],
params.require(:proposal).permit(:title, :question, :summary, :description, :external_url,
:video_url, :responsible_name, :tag_list, :terms_of_service,
:geozone_id, :skip_map, image_attributes: image_attributes,
documents_attributes: [:id, :title, :attachment,
:cached_attachment, :user_id, :_destroy],
map_location_attributes: [:latitude, :longitude, :zoom])
end