diff options
author | Eugenia Grieff <egrieff@gitlab.com> | 2019-10-22 16:57:55 +0100 |
---|---|---|
committer | Eugenia Grieff <egrieff@gitlab.com> | 2019-10-22 16:57:55 +0100 |
commit | b58dd075d32e852e6c7ab306c84945cb5d73c06a (patch) | |
tree | d4b494bc2bda9edf65ffcbde56ed3f949d33e0b0 /app/models/project.rb | |
parent | 1425a56c75beecaa289ad59587d636f8f469509e (diff) | |
download | gitlab-ce-b58dd075d32e852e6c7ab306c84945cb5d73c06a.tar.gz |
Fix labels finder to filter issuables
Use project scopes to filter project labels that are visible for user
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 3525f37f8d5..1aecf3ef6ab 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -609,11 +609,11 @@ class Project < ApplicationRecord joins(:namespace).where(namespaces: { type: 'Group' }).select(:namespace_id) end - # Returns ids of projects with milestones available for given user + # Returns ids of projects with issuables available for given user # - # Used on queries to find milestones which user can see - # For example: Milestone.where(project_id: ids_with_milestone_available_for(user)) - def ids_with_milestone_available_for(user) + # Used on queries to find milestones or labels which user can see + # For example: Milestone.where(project_id: ids_with_issuables_available_for(user)) + def ids_with_issuables_available_for(user) with_issues_enabled = with_issues_available_for_user(user).select(:id) with_merge_requests_enabled = with_merge_requests_available_for_user(user).select(:id) |