app/controllers/proposals_controller.rb
Class ProposalsController
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class ProposalsController < ApplicationController
include FeatureFlags
include CommentableActions
include FlagActions
Line is too long. [108/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
params.require(:proposal).permit(:title, :question, :summary, :description, :external_url, :video_url,
- Exclude checks
Line is too long. [112/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
redirect_to proposal_path(@proposal), status: :moved_permanently if request.path != proposal_path(@proposal)
- Exclude checks
Line is too long. [111/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
:responsible_name, :tag_list, :terms_of_service, :geozone_id, :skip_map,
- Exclude checks
Line is too long. [121/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
@proposal.errors.add(:retired_reason, I18n.t('errors.messages.blank')) if params[:proposal][:retired_reason].blank?
- Exclude checks
Line is too long. [131/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
@proposal.errors.add(:retired_explanation, I18n.t('errors.messages.blank')) if params[:proposal][:retired_explanation].blank?
- Exclude checks
Line is too long. [129/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy],
- Exclude checks
Line is too long. [155/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
return unless !@advanced_search_terms && @search_terms.blank? && @tag_filter.blank? && params[:retired].blank? && @current_order != "recommendations"
- Exclude checks
Line is too long. [125/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
image_attributes: [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy],
- Exclude checks
Line is too long. [126/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
@resources = @resources.where(retired_reason: params[:retired]) if Proposal::RETIRE_OPTIONS.include?(params[:retired])
- Exclude checks
Line is too long. [114/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
if map_location && (map_location[:longitude] && map_location[:latitude]).blank? && !map_location[:id].blank?
- Exclude checks
%w
-literals should be delimited by [
and ]
. (https://github.com/bbatsov/ruby-style-guide#percent-literal-braces) Open
Open
has_orders %w{most_voted newest oldest}, only: :show
- Read upRead up
- Exclude checks
This cop enforces the consistent usage of %
-literal delimiters.
Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.
Example:
# Style/PercentLiteralDelimiters:
# PreferredDelimiters:
# default: '[]'
# '%i': '()'
# good
%w[alpha beta] + %i(gamma delta)
# bad
%W(alpha #{beta})
# bad
%I(alpha beta)
Line is too long. [105/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits) Open
Open
@related_contents = Kaminari.paginate_array(@proposal.relationed_contents).page(params[:page]).per(5)
- Exclude checks