diff options
Diffstat (limited to 'app/controllers/profiles/notifications_controller.rb')
-rw-r--r-- | app/controllers/profiles/notifications_controller.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/profiles/notifications_controller.rb b/app/controllers/profiles/notifications_controller.rb index 9323d266cd5..b663a75f04a 100644 --- a/app/controllers/profiles/notifications_controller.rb +++ b/app/controllers/profiles/notifications_controller.rb @@ -43,7 +43,10 @@ class Profiles::NotificationsController < Profiles::ApplicationController .preload_source_route projects = project_notifications.map(&:source) - ActiveRecord::Associations::Preloader.new.preload(projects, { namespace: [:route, :owner], group: [] }) + ActiveRecord::Associations::Preloader.new( + records: projects, + associations: { namespace: [:route, :owner], group: [] } + ).call Preloaders::UserMaxAccessLevelInProjectsPreloader.new(projects, current_user).execute project_notifications.select { |notification| current_user.can?(:read_project, notification.source) } |