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/field_format.rb | |
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/field_format.rb')
-rw-r--r-- | lib/redmine/field_format.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/redmine/field_format.rb b/lib/redmine/field_format.rb index 55800dd6b..e74dc20d7 100644 --- a/lib/redmine/field_format.rb +++ b/lib/redmine/field_format.rb @@ -868,7 +868,7 @@ module Redmine def possible_values_records(custom_field, object=nil) if object.is_a?(Array) - projects = object.map {|o| o.respond_to?(:project) ? o.project : nil}.compact.uniq + projects = object.filter_map {|o| o.respond_to?(:project) ? o.project : nil}.uniq projects.map {|project| possible_values_records(custom_field, project)}.reduce(:&) || [] elsif object.respond_to?(:project) && object.project scope = object.project.users @@ -934,7 +934,7 @@ module Redmine def possible_values_records(custom_field, object=nil, all_statuses=false) if object.is_a?(Array) - projects = object.map {|o| o.respond_to?(:project) ? o.project : nil}.compact.uniq + projects = object.filter_map {|o| o.respond_to?(:project) ? o.project : nil}.uniq projects.map {|project| possible_values_records(custom_field, project)}.reduce(:&) || [] elsif object.respond_to?(:project) && object.project scope = object.project.shared_versions |