diff options
author | Go MAEDA <maeda@farend.jp> | 2023-01-17 01:38:27 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2023-01-17 01:38:27 +0000 |
commit | 0b6f4c6811a4a4e823674e3bb8b970ee46a9194b (patch) | |
tree | 341119beb1c247727c68ba9913a7a2bfc3fa3006 /lib/redmine/helpers | |
parent | 97d07eb28573060085352e0e9046be16e29f5bfd (diff) | |
download | redmine-0b6f4c6811a4a4e823674e3bb8b970ee46a9194b.tar.gz redmine-0b6f4c6811a4a4e823674e3bb8b970ee46a9194b.zip |
Ruby 2.7: Fix RuboCop offense Performance/MapCompact (#38134).
git-svn-id: https://svn.redmine.org/redmine/trunk@22055 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/helpers')
-rw-r--r-- | lib/redmine/helpers/gantt.rb | 2 | ||||
-rw-r--r-- | lib/redmine/helpers/time_report.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb index 448d3190e..3614829db 100644 --- a/lib/redmine/helpers/gantt.rb +++ b/lib/redmine/helpers/gantt.rb @@ -198,7 +198,7 @@ module Redmine # Returns the distinct versions of the issues that belong to +project+ def project_versions(project) - project_issues(project).collect(&:fixed_version).compact.uniq + project_issues(project).filter_map(&:fixed_version).uniq end # Returns the issues that belong to +project+ and are assigned to +version+ diff --git a/lib/redmine/helpers/time_report.rb b/lib/redmine/helpers/time_report.rb index 79ac6b020..c6e98ebf1 100644 --- a/lib/redmine/helpers/time_report.rb +++ b/lib/redmine/helpers/time_report.rb @@ -49,7 +49,7 @@ module Redmine @scope.includes(:activity). reorder(nil). group(@criteria.collect{|criteria| @available_criteria[criteria][:sql]} + time_columns). - joins(@criteria.collect{|criteria| @available_criteria[criteria][:joins]}.compact). + joins(@criteria.filter_map{|criteria| @available_criteria[criteria][:joins]}). sum(:hours).each do |hash, hours| h = {'hours' => hours} (@criteria + time_columns).each_with_index do |name, i| |