mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-31 19:47:14 +00:00
Fix RuboCop offense Style/CollectionCompact (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@22921 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
480975a0f5
commit
47d7dd0187
@ -179,7 +179,6 @@ Layout/MultilineOperationIndentation:
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Layout/SpaceAfterComma:
|
||||
Exclude:
|
||||
- 'app/controllers/projects_controller.rb'
|
||||
- 'lib/redmine/configuration.rb'
|
||||
- 'lib/redmine/helpers/time_report.rb'
|
||||
- 'lib/redmine/imap.rb'
|
||||
@ -900,14 +899,6 @@ Style/ClassVars:
|
||||
- 'lib/redmine/wiki_formatting/markdown/formatter.rb'
|
||||
- 'test/helpers/activities_helper_test.rb'
|
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: AllowedReceivers.
|
||||
Style/CollectionCompact:
|
||||
Exclude:
|
||||
- 'app/controllers/issues_controller.rb'
|
||||
- 'app/controllers/projects_controller.rb'
|
||||
- 'lib/redmine/sudo_mode.rb'
|
||||
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
Style/ColonMethodCall:
|
||||
Exclude:
|
||||
|
||||
@ -700,11 +700,10 @@ class IssuesController < ApplicationController
|
||||
def redirect_after_create
|
||||
if params[:continue]
|
||||
url_params = {}
|
||||
url_params[:issue] =
|
||||
{
|
||||
:tracker_id => @issue.tracker,
|
||||
:parent_issue_id => @issue.parent_issue_id
|
||||
}.reject {|k, v| v.nil?}
|
||||
url_params[:issue] = {
|
||||
:tracker_id => @issue.tracker,
|
||||
:parent_issue_id => @issue.parent_issue_id
|
||||
}.compact
|
||||
url_params[:back_url] = params[:back_url].presence
|
||||
|
||||
if params[:project_id]
|
||||
|
||||
@ -115,7 +115,7 @@ class ProjectsController < ApplicationController
|
||||
format.html do
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
if params[:continue]
|
||||
attrs = {:parent_id => @project.parent_id}.reject {|k,v| v.nil?}
|
||||
attrs = {:parent_id => @project.parent_id}.compact
|
||||
redirect_to new_project_path(attrs)
|
||||
else
|
||||
redirect_to settings_project_path(@project)
|
||||
|
||||
@ -47,7 +47,7 @@ module Redmine
|
||||
#
|
||||
# taken from https://github.com/brianhempel/hash_to_hidden_fields
|
||||
def hash_to_hidden_fields(hash)
|
||||
cleaned_hash = hash.to_unsafe_h.reject {|k, v| v.nil?}
|
||||
cleaned_hash = hash.to_unsafe_h.compact
|
||||
pairs = cleaned_hash.to_query.split(Rack::Utils::DEFAULT_SEP)
|
||||
tags = pairs.map do |pair|
|
||||
key, value = pair.split('=', 2).map {|str| Rack::Utils.unescape(str)}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user