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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
e3daa73f
Commit
e3daa73f
authored
Sep 19, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Setup children in a a method and reuse for both calls
parent
9781ac55
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
app/controllers/groups_controller.rb
app/controllers/groups_controller.rb
+7
-4
No files found.
app/controllers/groups_controller.rb
View file @
e3daa73f
...
...
@@ -45,8 +45,7 @@ class GroupsController < Groups::ApplicationController
end
def
show
@children
=
GroupChildrenFinder
.
new
(
current_user
,
parent_group:
@group
,
params:
params
).
execute
@children
=
@children
.
page
(
params
[
:page
])
setup_children
(
@group
)
respond_to
do
|
format
|
format
.
html
...
...
@@ -69,8 +68,7 @@ class GroupsController < Groups::ApplicationController
render_404
end
@children
=
GroupChildrenFinder
.
new
(
current_user
,
parent_group:
parent
,
params:
params
).
execute
@children
=
@children
.
page
(
params
[
:page
])
setup_children
(
parent
)
respond_to
do
|
format
|
format
.
json
do
...
...
@@ -119,6 +117,11 @@ class GroupsController < Groups::ApplicationController
protected
def
setup_children
(
parent
)
@children
=
GroupChildrenFinder
.
new
(
current_user
,
parent_group:
parent
,
params:
params
).
execute
@children
=
@children
.
page
(
params
[
:page
])
end
def
setup_projects
set_non_archived_param
params
[
:sort
]
||=
'latest_activity_desc'
...
...
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