diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-09 09:11:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-09 09:11:32 +0300 |
commit | 7b29a4f84e25ab3eb610c1595bad38478784f5ff (patch) | |
tree | 0ef83174d3c5bd5714cf91d1f31059d6fb654d45 /app/models/preloaders | |
parent | 6faeb44a01f086482b8905b36b591cdb5797470a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/preloaders')
-rw-r--r-- | app/models/preloaders/user_max_access_level_in_projects_preloader.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/preloaders/user_max_access_level_in_projects_preloader.rb b/app/models/preloaders/user_max_access_level_in_projects_preloader.rb index 2e2272a2ef5..4897d90ad06 100644 --- a/app/models/preloaders/user_max_access_level_in_projects_preloader.rb +++ b/app/models/preloaders/user_max_access_level_in_projects_preloader.rb @@ -7,9 +7,11 @@ module Preloaders def initialize(projects, user) @projects = if projects.is_a?(Array) Project.where(id: projects) - else + elsif Feature.enabled?(:projects_preloader_fix) # Push projects base query in to a sub-select to avoid # table name clashes. Performs better than aliasing. + Project.where(id: projects.subquery(:id)) + else Project.where(id: projects.reselect(:id)) end |