summaryrefslogtreecommitdiff
path: root/app/controllers/groups/labels_controller.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-04-03 00:09:02 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-03 00:09:02 +0000
commit4d6582cc54cc317bc31cc8dc2339668bb7550ced (patch)
treea5840938cd13e64c0db27792faecb3fd7f6fa782 /app/controllers/groups/labels_controller.rb
parent65be6f9dd4d92590294f18c6212a075585467f6d (diff)
downloadgitlab-ce-4d6582cc54cc317bc31cc8dc2339668bb7550ced.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/controllers/groups/labels_controller.rb')
-rw-r--r--app/controllers/groups/labels_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/groups/labels_controller.rb b/app/controllers/groups/labels_controller.rb
index c5dd3e1df35..d1c32350b1d 100644
--- a/app/controllers/groups/labels_controller.rb
+++ b/app/controllers/groups/labels_controller.rb
@@ -16,7 +16,8 @@ class Groups::LabelsController < Groups::ApplicationController
format.html do
# at group level we do not want to list project labels,
# we only want `only_group_labels = false` when pulling labels for label filter dropdowns, fetched through json
- @labels = available_labels(params.merge(only_group_labels: true)).page(params[:page])
+ @labels = available_labels(params.merge(only_group_labels: true)).includes(:group).page(params[:page]) # rubocop: disable CodeReuse/ActiveRecord
+ @labels.each { |label| label.lazy_subscription(current_user) } # preload subscriptions
end
format.json do
render json: LabelSerializer.new.represent_appearance(available_labels)