Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-30 00:10:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-30 00:10:10 +0300
commite4df6a7c53ab6e9dd6d63516ca9e0ad143cfa17a (patch)
tree7a4b5a3a99f19f8610df164e9e5cdd4a461d1465 /app/models/user.rb
parent13592f8455bfd17acd7cb10ccea015e3b63c155d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 2824d192375..bfb0c29a023 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1576,10 +1576,11 @@ class User < ApplicationRecord
.order('routes.path')
end
- def namespaces
- namespace_ids = groups.pluck(:id)
- namespace_ids.push(namespace.id)
- Namespace.where(id: namespace_ids)
+ def namespaces(owned_only: false)
+ user_groups = owned_only ? owned_groups : groups
+ personal_namespace = Namespace.where(id: namespace.id)
+
+ Namespace.from_union([user_groups, personal_namespace])
end
def oauth_authorized_tokens