Commit 2908f173 authored by Robert Speicher's avatar Robert Speicher

Improve clarity of variable names in ProjectTeam#fetch_invited_members

parent 6f558121
...@@ -233,28 +233,26 @@ class ProjectTeam ...@@ -233,28 +233,26 @@ class ProjectTeam
return invited_members unless project_shared_with_group? return invited_members unless project_shared_with_group?
project.project_group_links.includes(group: [:group_members]).each do |group_link| project.project_group_links.includes(group: [:group_members]).each do |link|
invited_group = group_link.group invited_group_members = link.group.members
im = invited_group.members
if level if level
int_level = GroupMember.access_level_roles[level.to_s.singularize.titleize] numeric_level = GroupMember.access_level_roles[level.to_s.singularize.titleize]
# Skip group members if we ask for masters # If we're asked for a level that's higher than the group's access,
# but max group access is developers # there's nothing left to do
next if int_level > group_link.group_access next if numeric_level > link.group_access
# If we ask for developers and max # Make sure we include everyone _above_ the requested level as well
# group access is developers we need to provide if numeric_level == link.group_access
# both group master, developers as devs invited_group_members = invited_group_members
if int_level == group_link.group_access .where("access_level >= ?", link.group_access)
im = im.where("access_level >= ?", group_link.group_access)
else else
im = im.send(level) invited_group_members = invited_group_members.send(level)
end end
end end
invited_members << im invited_members << invited_group_members
end end
invited_members.flatten.compact invited_members.flatten.compact
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment