diff options
author | Stan Hu <stanhu@gmail.com> | 2018-06-03 13:31:41 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-06-05 02:39:33 +0300 |
commit | cbc20d2b7f8c73e2892c0c458619df2a9fe0c9ab (patch) | |
tree | 5f99239e63863d4631fe46c44363ee703c3b2a37 /lib | |
parent | fe0ebf76c49e2512b211c5d43152275c536f7e3a (diff) |
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')
-rw-r--r-- | lib/api/issues.rb | 2 |
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 |