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
0b4f9ff4
Commit
0b4f9ff4
authored
Jun 04, 2018
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sh-fix-source-project-nplus-one' into 'master'
Fix N+1 with source_projects in merge requests API See merge request gitlab-org/gitlab-ce!19346
parents
c63cd738
bd4bfcc6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
sh-fix-source-project-nplus-one.yml
changelogs/unreleased/sh-fix-source-project-nplus-one.yml
+5
-0
merge_requests.rb
lib/api/merge_requests.rb
+1
-1
No files found.
changelogs/unreleased/sh-fix-source-project-nplus-one.yml
0 → 100644
View file @
0b4f9ff4
---
title
:
Fix N+1 with source_projects in merge requests API
merge_request
:
author
:
type
:
performance
lib/api/merge_requests.rb
View file @
0b4f9ff4
...
@@ -38,7 +38,7 @@ module API
...
@@ -38,7 +38,7 @@ module API
merge_requests
=
MergeRequestsFinder
.
new
(
current_user
,
args
).
execute
merge_requests
=
MergeRequestsFinder
.
new
(
current_user
,
args
).
execute
.
reorder
(
args
[
:order_by
]
=>
args
[
:sort
])
.
reorder
(
args
[
:order_by
]
=>
args
[
:sort
])
merge_requests
=
paginate
(
merge_requests
)
merge_requests
=
paginate
(
merge_requests
)
.
preload
(
:target_project
)
.
preload
(
:
source_project
,
:
target_project
)
return
merge_requests
if
args
[
:view
]
==
'simple'
return
merge_requests
if
args
[
:view
]
==
'simple'
...
...
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