Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
503cf3f1
Commit
503cf3f1
authored
Nov 18, 2021
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary UserNamespace TODOs
parent
25a12464
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
7 deletions
+1
-7
app/models/namespace.rb
app/models/namespace.rb
+1
-3
app/models/namespaces/user_namespace.rb
app/models/namespaces/user_namespace.rb
+0
-2
spec/factories/namespaces.rb
spec/factories/namespaces.rb
+0
-2
No files found.
app/models/namespace.rb
View file @
503cf3f1
...
...
@@ -51,9 +51,7 @@ class Namespace < ApplicationRecord
# This should _not_ be `inverse_of: :namespace`, because that would also set
# `user.namespace` when this user creates a group with themselves as `owner`.
# TODO: can this be moved into the UserNamespace class?
# evaluate in issue https://gitlab.com/gitlab-org/gitlab/-/issues/341070
belongs_to
:owner
,
class_name:
"User"
belongs_to
:owner
,
class_name:
'User'
belongs_to
:parent
,
class_name:
"Namespace"
has_many
:children
,
->
{
where
(
type:
Group
.
sti_name
)
},
class_name:
"Namespace"
,
foreign_key: :parent_id
...
...
app/models/namespaces/user_namespace.rb
View file @
503cf3f1
# frozen_string_literal: true
# TODO: currently not created/mapped in the database, will be done in another issue
# https://gitlab.com/gitlab-org/gitlab/-/issues/341070
module
Namespaces
####################################################################
# PLEASE DO NOT OVERRIDE METHODS IN THIS CLASS!
...
...
spec/factories/namespaces.rb
View file @
503cf3f1
...
...
@@ -5,8 +5,6 @@ FactoryBot.define do
sequence
(
:name
)
{
|
n
|
"namespace
#{
n
}
"
}
path
{
name
.
downcase
.
gsub
(
/\s/
,
'_'
)
}
# TODO: can this be moved into the :user_namespace factory?
# evaluate in issue https://gitlab.com/gitlab-org/gitlab/-/issues/341070
owner
{
association
(
:user
,
strategy: :build
,
namespace:
instance
,
username:
path
)
}
trait
:with_aggregation_schedule
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment