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
46ae8325
Commit
46ae8325
authored
May 18, 2017
by
Douwe Maan
Committed by
Michael Kozono
May 18, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Namespace.for_user scope (formerly known as Namespace.root)
parent
e1cc4671
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
app/models/namespace.rb
app/models/namespace.rb
+1
-1
app/models/user.rb
app/models/user.rb
+2
-4
No files found.
app/models/namespace.rb
View file @
46ae8325
...
@@ -47,7 +47,7 @@ class Namespace < ActiveRecord::Base
...
@@ -47,7 +47,7 @@ class Namespace < ActiveRecord::Base
before_destroy
(
prepend:
true
)
{
prepare_for_destroy
}
before_destroy
(
prepend:
true
)
{
prepare_for_destroy
}
after_destroy
:rm_dir
after_destroy
:rm_dir
scope
:
root
,
->
{
where
(
'type IS NULL'
)
}
scope
:
for_user
,
->
{
where
(
'type IS NULL'
)
}
scope
:with_statistics
,
->
do
scope
:with_statistics
,
->
do
joins
(
'LEFT JOIN project_statistics ps ON ps.namespace_id = namespaces.id'
)
joins
(
'LEFT JOIN project_statistics ps ON ps.namespace_id = namespaces.id'
)
...
...
app/models/user.rb
View file @
46ae8325
...
@@ -371,10 +371,8 @@ class User < ActiveRecord::Base
...
@@ -371,10 +371,8 @@ class User < ActiveRecord::Base
end
end
def
find_by_full_path
(
path
,
follow_redirects:
false
)
def
find_by_full_path
(
path
,
follow_redirects:
false
)
namespace
=
Namespace
.
find_by_full_path
(
path
,
follow_redirects:
follow_redirects
)
namespace
=
Namespace
.
for_user
.
find_by_full_path
(
path
,
follow_redirects:
follow_redirects
)
return
unless
namespace
&&
namespace
.
kind
==
'user'
namespace
&
.
owner
namespace
.
owner
end
end
def
non_ldap
def
non_ldap
...
...
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