From: Toshi MARUYAMA Date: Sat, 3 Oct 2020 15:37:14 +0000 (+0000) Subject: shorten long line of app/models/group.rb X-Git-Tag: 4.2.0~699 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2b9796d4a29a528d6d4a0db38cc0c39afc712026;p=redmine.git shorten long line of app/models/group.rb git-svn-id: http://svn.redmine.org/redmine/trunk@20118 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- 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