Commit 29d84b61 authored by Jacopo's avatar Jacopo

Fixes linter errors

parent 0d6374ac
......@@ -12,25 +12,25 @@ module API
end
def find_all_members(source_type, source)
members = (source_type == 'project') ? find_all_members_for_project(source) : find_all_members_for_group(source)
members.non_invite.
non_request
members = source_type == 'project' ? find_all_members_for_project(source) : find_all_members_for_group(source)
members.non_invite
.non_request
end
def find_all_members_for_project(project)
shared_group_ids = project.project_group_links.pluck(:group_id)
source_ids = [project.id, project.group&.id].concat(shared_group_ids).compact
Member.includes(:user).
joins(user: :project_authorizations).
where(project_authorizations: { project_id: project.id }).
where(source_id: source_ids)
Member.includes(:user)
.joins(user: :project_authorizations)
.where(project_authorizations: { project_id: project.id })
.where(source_id: source_ids)
end
def find_all_members_for_group(group)
source_ids = group.self_and_ancestors.pluck(:id)
Member.includes(:user).
where(source_id: source_ids).
where(source_type: 'Namespace')
Member.includes(:user)
.where(source_id: source_ids)
.where(source_type: 'Namespace')
end
end
end
......
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