Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
069eb03076e1
Commit
069eb030
authored
Mar 14, 2014
by
Dmitriy Zaporozhets
Browse files
Project must have namespace for Project#find_with_namespace
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
3c3b87a37a04
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/models/project.rb
View file @
069eb030
...
...
@@ -177,8 +177,5 @@
end
def
find_with_namespace
(
id
)
if
id
.
include?
(
"/"
)
id
=
id
.
split
(
"/"
)
namespace
=
Namespace
.
find_by
(
path:
id
.
first
)
return
nil
unless
namespace
return
nil
unless
id
.
include?
(
"/"
)
...
...
@@ -184,8 +181,9 @@
where
(
namespace_id:
namespace
.
id
).
find_by
(
path:
id
.
second
)
else
where
(
path:
id
,
namespace_id:
nil
).
last
end
id
=
id
.
split
(
"/"
)
namespace
=
Namespace
.
find_by
(
path:
id
.
first
)
return
nil
unless
namespace
where
(
namespace_id:
namespace
.
id
).
find_by
(
path:
id
.
second
)
end
def
visibility_levels
...
...
Write
Preview
Supports
Markdown
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