summaryrefslogtreecommitdiffstats
path: root/app/models/member.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2023-01-17 01:38:27 +0000
committerGo MAEDA <maeda@farend.jp>2023-01-17 01:38:27 +0000
commit0b6f4c6811a4a4e823674e3bb8b970ee46a9194b (patch)
tree341119beb1c247727c68ba9913a7a2bfc3fa3006 /app/models/member.rb
parent97d07eb28573060085352e0e9046be16e29f5bfd (diff)
downloadredmine-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 'app/models/member.rb')
-rw-r--r--app/models/member.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/models/member.rb b/app/models/member.rb
index 46a81afc0..21c623408 100644
--- a/app/models/member.rb
+++ b/app/models/member.rb
@@ -120,8 +120,7 @@ class Member < ActiveRecord::Base
def role_inheritance(role)
member_roles.
select {|mr| mr.role_id == role.id && mr.inherited_from.present?}.
- map {|mr| mr.inherited_from_member_role.try(:member)}.
- compact.
+ filter_map {|mr| mr.inherited_from_member_role.try(:member)}.
map {|m| m.project == project ? m.principal : m.project}
end