summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorDJ Mountney <david@twkie.net>2018-04-04 12:49:08 -0700
committerDJ Mountney <david@twkie.net>2018-04-04 12:49:08 -0700
commit39bb3720381af64039673cf21705fcf95cf78314 (patch)
treec32aa05ee2eaa2e0b93ec811a6ad8f3aa71a207e /lib/api/helpers.rb
parentf7f92836400ec86c74d1140223c009d3d328aea9 (diff)
parent166b4575a6353668c894fea0ba234d0b371dee03 (diff)
downloadgitlab-ce-39bb3720381af64039673cf21705fcf95cf78314.tar.gz
Merge remote-tracking branch 'origin/master' into dev-master
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index e59e8a45908..61c138a7dec 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -83,12 +83,13 @@ module API
end
def available_labels_for(label_parent)
- search_params =
- if label_parent.is_a?(Project)
- { project_id: label_parent.id }
- else
- { group_id: label_parent.id, only_group_labels: true }
- end
+ search_params = { include_ancestor_groups: true }
+
+ if label_parent.is_a?(Project)
+ search_params[:project_id] = label_parent.id
+ else
+ search_params.merge!(group_id: label_parent.id, only_group_labels: true)
+ end
LabelsFinder.new(current_user, search_params).execute
end