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|