summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-06-03 03:31:41 -0700
committerStan Hu <stanhu@gmail.com>2018-06-04 16:44:03 -0700
commitc26cbfcdfb6a0c83253f42be016692abc3548e8c (patch)
treea37bfb6b04bb47d2d5494e3522996afcbdc5716b /lib/api
parentbb2a847c8381dba03ac261c64e0022bf4823f912 (diff)
downloadgitlab-ce-c26cbfcdfb6a0c83253f42be016692abc3548e8c.tar.gz
Remove N+1 query for author in issues API
This was being masked by the statement cache because only one author was used per issue in the test.. Also adds support for an Rspec matcher `exceed_all_query_limit`.
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/issues.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index b64f465ce56..25185d6edc8 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -16,7 +16,7 @@ module API
args[:scope] = args[:scope].underscore if args[:scope]
issues = IssuesFinder.new(current_user, args).execute
- .preload(:assignees, :labels, :notes, :timelogs, :project)
+ .preload(:assignees, :labels, :notes, :timelogs, :project, :author)
issues.reorder(args[:order_by] => args[:sort])
end