summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2024-09-05 00:49:54 +0000
committerGo MAEDA <maeda@farend.jp>2024-09-05 00:49:54 +0000
commitb7120cfe3a055eb2fd930589c3dc6a59aef0584d (patch)
tree8da07535a1554c95e13b90c1db7ace3462c694f5
parent7841e933d4389b9619dd96c38b1229e5a973f223 (diff)
downloadredmine-b7120cfe3a055eb2fd930589c3dc6a59aef0584d.tar.gz
redmine-b7120cfe3a055eb2fd930589c3dc6a59aef0584d.zip
Remove unnecessary rubocop:disable directive for Style/EmptyLiteral (#39887).
RuboCop’s Style/EmptyLiteral false positive for `Hash.new([])` was resolved in RuboCop 1.66.1. This commit updates the RuboCop version to 1.66.1 and removes the now-unnecessary `rubocop:disable` directives. git-svn-id: https://svn.redmine.org/redmine/trunk@23013 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--Gemfile2
-rw-r--r--app/models/user.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/Gemfile b/Gemfile
index 8c09152a8..38aa62c8a 100644
--- a/Gemfile
+++ b/Gemfile
@@ -107,7 +107,7 @@ group :test do
gem "capybara", ">= 3.39"
gem 'selenium-webdriver', '>= 4.11.0'
# RuboCop
- gem 'rubocop', '~> 1.66.0', require: false
+ gem 'rubocop', '~> 1.66.1', require: false
gem 'rubocop-performance', '~> 1.21.0', require: false
gem 'rubocop-rails', '~> 2.26.0', require: false
end
diff --git a/app/models/user.rb b/app/models/user.rb
index 2f4baba58..cc4489662 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -643,7 +643,7 @@ class User < Principal
def projects_by_role
return @projects_by_role if @projects_by_role
- result = Hash.new([]) # rubocop:disable Style/EmptyLiteral
+ result = Hash.new([])
project_ids_by_role.each do |role, ids|
result[role] = Project.where(:id => ids).to_a
end
@@ -676,7 +676,7 @@ class User < Principal
hash[role_id] << project_id
end
- result = Hash.new([]) # rubocop:disable Style/EmptyLiteral
+ result = Hash.new([])
if hash.present?
roles = Role.where(:id => hash.keys).to_a
hash.each do |role_id, proj_ids|