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
2a915497
Commit
2a915497
authored
Dec 03, 2019
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract executing batch counting
parent
105ac2b6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
lib/api/projects.rb
lib/api/projects.rb
+6
-1
lib/api/projects_relation_builder.rb
lib/api/projects_relation_builder.rb
+2
-3
No files found.
lib/api/projects.rb
View file @
2a915497
...
...
@@ -93,7 +93,12 @@ module API
)
options
[
:with
]
=
Entities
::
BasicProjectDetails
if
params
[
:simple
]
present
options
[
:with
].
prepare_relation
(
projects
,
options
),
options
projects
=
options
[
:with
].
prepare_relation
(
projects
,
options
)
# Refresh count caches
options
[
:with
].
execute_batch_counting
(
projects
)
present
projects
,
options
end
def
translate_params_for_compatibility
(
params
)
...
...
lib/api/projects_relation_builder.rb
View file @
2a915497
...
...
@@ -5,10 +5,9 @@ module API
extend
ActiveSupport
::
Concern
class_methods
do
# Prepare the given projects relation, e.g. perform preloading.
def
prepare_relation
(
projects_relation
,
options
=
{})
projects_relation
=
preload_relation
(
projects_relation
,
options
)
execute_batch_counting
(
projects_relation
)
projects_relation
preload_relation
(
projects_relation
,
options
)
end
def
preload_relation
(
projects_relation
,
options
=
{})
...
...
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