diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 12:10:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 12:10:52 +0300 |
commit | a7b422860c90eecd1b98845d234a8347686fbdcf (patch) | |
tree | f4a63124ef328ce146a82453b091e10f8189da36 /app/models/preloaders | |
parent | b2362c5f21e373820afc7d7a01ed104eaedd0e49 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/preloaders')
-rw-r--r-- | app/models/preloaders/project_root_ancestor_preloader.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/preloaders/project_root_ancestor_preloader.rb b/app/models/preloaders/project_root_ancestor_preloader.rb index 8d04e71774c..1e935249407 100644 --- a/app/models/preloaders/project_root_ancestor_preloader.rb +++ b/app/models/preloaders/project_root_ancestor_preloader.rb @@ -21,7 +21,8 @@ module Preloaders ActiveRecord::Associations::Preloader.new.preload(@projects, :namespace) @projects.each do |project| - project.namespace.root_ancestor = root_ancestors_by_id[project.id]&.first + root_ancestor = root_ancestors_by_id[project.id]&.first + project.namespace.root_ancestor = root_ancestor if root_ancestor.present? end end |