Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
748345e062f6
Commit
cd8e1b85
authored
Sep 22, 2017
by
Bob Van Landuyt
Browse files
Keep the `parent` method in `Project`
parent
89b91bbf6260
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/concerns/group_descendant.rb
View file @
748345e0
...
...
@@ -3,14 +3,6 @@ def hierarchy(hierarchy_base = nil)
expand_hierarchy_for_child
(
self
,
self
,
hierarchy_base
)
end
def
parent
if
self
.
is_a?
(
Project
)
namespace
else
super
end
end
def
expand_hierarchy_for_child
(
child
,
hierarchy
,
hierarchy_base
)
if
child
.
parent
.
nil?
&&
hierarchy_base
.
present?
raise
ArgumentError
.
new
(
'specified base is not part of the tree'
)
...
...
app/models/project.rb
View file @
748345e0
...
...
@@ -1521,6 +1521,10 @@ def public_path_for_source_path(path, commit_sha)
map
.
public_path_for_source_path
(
path
)
end
def
parent
namespace
end
def
parent_changed?
namespace_id_changed?
end
...
...
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