From cfbaef3f1c28cdb9b15615215b87167181cb210f Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 6 Feb 2020 03:08:47 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- app/controllers/profiles/notifications_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/controllers/profiles') diff --git a/app/controllers/profiles/notifications_controller.rb b/app/controllers/profiles/notifications_controller.rb index d295b64082c..064b2a2cc12 100644 --- a/app/controllers/profiles/notifications_controller.rb +++ b/app/controllers/profiles/notifications_controller.rb @@ -4,13 +4,14 @@ class Profiles::NotificationsController < Profiles::ApplicationController # rubocop: disable CodeReuse/ActiveRecord def show @user = current_user - @group_notifications = current_user.notification_settings.for_groups.order(:id) + @group_notifications = current_user.notification_settings.preload_source_route.for_groups.order(:id) @group_notifications += GroupsFinder.new( current_user, all_available: false, exclude_group_ids: @group_notifications.select(:source_id) ).execute.map { |group| current_user.notification_settings_for(group, inherit: true) } @project_notifications = current_user.notification_settings.for_projects.order(:id) + .preload_source_route .select { |notification| current_user.can?(:read_project, notification.source) } @global_notification_setting = current_user.global_notification_setting end -- cgit v1.2.3