From 987a36281a010ea1589e13a9d495252866e3e2db Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Sun, 1 Sep 2024 00:42:33 +0000 Subject: [PATCH] Fix RuboCop offense Style/EmptyLiteral (#39887). git-svn-id: https://svn.redmine.org/redmine/trunk@23002 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/user.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index c3f183fc7..f827b8cba 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -641,7 +641,7 @@ class User < Principal def projects_by_role return @projects_by_role if @projects_by_role - result = Hash.new([]) + result = {} project_ids_by_role.each do |role, ids| result[role] = Project.where(:id => ids).to_a end @@ -674,7 +674,7 @@ class User < Principal hash[role_id] << project_id end - result = Hash.new([]) + result = {} if hash.present? roles = Role.where(:id => hash.keys).to_a hash.each do |role_id, proj_ids| -- 2.39.5