From b7120cfe3a055eb2fd930589c3dc6a59aef0584d Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Thu, 5 Sep 2024 00:49:54 +0000 Subject: [PATCH] Remove unnecessary rubocop:disable directive for Style/EmptyLiteral (#39887). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- Gemfile | 2 +- app/models/user.rb | 4 ++-- 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|