BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
31f77568
Commit
31f77568
authored
Sep 19, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
`current_user:` as a keyword argument
parent
e3daa73f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
4 deletions
+9
-4
groups_controller.rb
app/controllers/groups_controller.rb
+3
-1
group_children_finder.rb
app/finders/group_children_finder.rb
+1
-1
group_child_entity.rb
app/serializers/group_child_entity.rb
+2
-1
group_children_finder_spec.rb
spec/finders/group_children_finder_spec.rb
+3
-1
No files found.
app/controllers/groups_controller.rb
View file @
31f77568
...
...
@@ -118,7 +118,9 @@ class GroupsController < Groups::ApplicationController
protected
def
setup_children
(
parent
)
@children
=
GroupChildrenFinder
.
new
(
current_user
,
parent_group:
parent
,
params:
params
).
execute
@children
=
GroupChildrenFinder
.
new
(
current_user:
current_user
,
parent_group:
parent
,
params:
params
).
execute
@children
=
@children
.
page
(
params
[
:page
])
end
...
...
app/finders/group_children_finder.rb
View file @
31f77568
...
...
@@ -3,7 +3,7 @@ class GroupChildrenFinder
attr_reader
:current_user
,
:parent_group
,
:params
def
initialize
(
current_user
=
nil
,
parent_group
:,
params:
{})
def
initialize
(
current_user
:
nil
,
parent_group
:,
params:
{})
@current_user
=
current_user
@parent_group
=
parent_group
@params
=
params
...
...
app/serializers/group_child_entity.rb
View file @
31f77568
...
...
@@ -55,7 +55,8 @@ class GroupChildEntity < Grape::Entity
unless:
lambda
{
|
_instance
,
_options
|
project?
}
def
children_finder
@children_finder
||=
GroupChildrenFinder
.
new
(
request
.
current_user
,
parent_group:
object
)
@children_finder
||=
GroupChildrenFinder
.
new
(
current_user:
request
.
current_user
,
parent_group:
object
)
end
def
children_count
...
...
spec/finders/group_children_finder_spec.rb
View file @
31f77568
...
...
@@ -4,7 +4,9 @@ describe GroupChildrenFinder do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:params
)
{
{}
}
subject
(
:finder
)
{
described_class
.
new
(
user
,
parent_group:
group
,
params:
params
)
}
subject
(
:finder
)
do
described_class
.
new
(
current_user:
user
,
parent_group:
group
,
params:
params
)
end
before
do
group
.
add_owner
(
user
)
...
...
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