]> source.dussan.org Git - redmine.git/commitdiff
shorten long line of app/models/group.rb
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 3 Oct 2020 15:37:14 +0000 (15:37 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 3 Oct 2020 15:37:14 +0000 (15:37 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20118 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/group.rb

index 2a1c2566d17937d89f0f3821637f671f7b888bc7..db3a51d0f2049aa9e9375db1982daea2b028c603 100644 (file)
@@ -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