diff options
Diffstat (limited to 'app/models/namespace.rb')
-rw-r--r-- | app/models/namespace.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index b7895f6cbf3..3ffd377251c 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -101,7 +101,9 @@ class Namespace < ApplicationRecord saved_change_to_name? || saved_change_to_path? || saved_change_to_parent_id? } - scope :for_user, -> { where(type: nil) } + # TODO: change to `type: Namespaces::UserNamespace.sti_name` when + # working on issue https://gitlab.com/gitlab-org/gitlab/-/issues/341070 + scope :user_namespaces, -> { where(type: [nil, Namespaces::UserNamespace.sti_name]) } scope :sort_by_type, -> { order(Gitlab::Database.nulls_first_order(:type)) } scope :include_route, -> { includes(:route) } scope :by_parent, -> (parent) { where(parent_id: parent) } @@ -143,9 +145,7 @@ class Namespace < ApplicationRecord when Namespaces::ProjectNamespace.sti_name Namespaces::ProjectNamespace when Namespaces::UserNamespace.sti_name - # TODO: We create a normal Namespace until - # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/68894 is ready - Namespace + Namespaces::UserNamespace else Namespace end |