Skip to content

Commit

Permalink
Merge pull request #6557 from coolo/fix_6548
Browse files Browse the repository at this point in the history
Preselect group_ids to ease SQL query for involved_packages
  • Loading branch information
coolo committed Dec 12, 2018
2 parents 80d3869 + dbed19c commit 130e7ce
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -639,12 +639,12 @@ def delete!
end

def involved_projects
Project.for_user(id).or(Project.for_group(groups))
Project.for_user(id).or(Project.for_group(group_ids))
end

# lists packages maintained by this user and are not in maintained projects
def involved_packages
Package.for_user(id).or(Package.for_group(groups)).where.not(project: involved_projects)
Package.for_user(id).or(Package.for_group(group_ids)).where.not(project: involved_projects)
end

# list packages owned by this user.
Expand Down

0 comments on commit 130e7ce

Please sign in to comment.