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
1c2be671
Commit
1c2be671
authored
Sep 12, 2013
by
Stephen Holdaway
Committed by
Dmitriy Zaporozhets
Sep 11, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix several_namespaces? to work with multiple ownership of groups
parent
ea55707b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
app/models/user.rb
app/models/user.rb
+1
-1
spec/models/user_spec.rb
spec/models/user_spec.rb
+13
-0
No files found.
app/models/user.rb
View file @
1c2be671
...
...
@@ -319,7 +319,7 @@ class User < ActiveRecord::Base
end
def
several_namespaces?
namespaces
.
many?
namespaces
.
many?
||
owned_groups
.
any?
end
def
namespace_id
...
...
spec/models/user_spec.rb
View file @
1c2be671
...
...
@@ -139,6 +139,19 @@ describe User do
it
{
@user
.
owned_groups
.
should
==
[
@group
]
}
end
describe
'group multiple owners'
do
before
do
ActiveRecord
::
Base
.
observers
.
enable
(
:user_observer
)
@user
=
create
:user
@user2
=
create
:user
@group
=
create
:group
,
owner:
@user
@group
.
add_users
([
@user2
.
id
],
UsersGroup
::
OWNER
)
end
it
{
@user2
.
several_namespaces?
.
should
be_true
}
end
describe
'namespaced'
do
before
do
ActiveRecord
::
Base
.
observers
.
enable
(
:user_observer
)
...
...
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