diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-09 21:07:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-09 21:07:50 +0300 |
commit | 20f6a17ba2d2d5f056bda38dfe85e2a7b2a82d0b (patch) | |
tree | 1319f393750fa7a212455746273c05465d786fde /app/models/preloaders | |
parent | e38a99eb0725697297386dd0bb1045b1fd55493a (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 | 2 | ||||
-rw-r--r-- | app/models/preloaders/user_max_access_level_in_projects_preloader.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/app/models/preloaders/project_root_ancestor_preloader.rb b/app/models/preloaders/project_root_ancestor_preloader.rb index 1e935249407..6192f79ce2c 100644 --- a/app/models/preloaders/project_root_ancestor_preloader.rb +++ b/app/models/preloaders/project_root_ancestor_preloader.rb @@ -9,7 +9,7 @@ module Preloaders end def execute - return if @projects.is_a?(ActiveRecord::NullRelation) + return unless @projects.is_a?(ActiveRecord::Relation) return unless ::Feature.enabled?(:use_traversal_ids) root_query = Namespace.joins("INNER JOIN (#{join_sql}) as root_query ON root_query.root_id = namespaces.id") 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 4897d90ad06..c9fd5e7718a 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 @@ -19,6 +19,8 @@ module Preloaders end def execute + return unless @user + project_authorizations = ProjectAuthorization.arel_table auths = @projects |