From 2b9796d4a29a528d6d4a0db38cc0c39afc712026 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 3 Oct 2020 15:37:14 +0000 Subject: [PATCH] shorten long line of app/models/group.rb git-svn-id: http://svn.redmine.org/redmine/trunk@20118 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/group.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/group.rb b/app/models/group.rb index 2a1c2566d..db3a51d0f 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -75,9 +75,13 @@ class Group < Principal def user_added(user) members.each do |member| next if member.project.nil? - user_member = Member.find_by_project_id_and_user_id(member.project_id, user.id) || Member.new(:project_id => member.project_id, :user_id => user.id) + + user_member = + Member.find_by_project_id_and_user_id(member.project_id, user.id) || + Member.new(:project_id => member.project_id, :user_id => user.id) member.member_roles.each do |member_role| - user_member.member_roles << MemberRole.new(:role => member_role.role, :inherited_from => member_role.id) + user_member.member_roles << MemberRole.new(:role => member_role.role, + :inherited_from => member_role.id) end user_member.save! end -- 2.39.5