diff options
author | Sean McGivern <sean@gitlab.com> | 2019-03-07 10:29:04 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-03-07 10:29:04 +0000 |
commit | 3781cbe0c3e56067ce60f63f83d7e3d292a03403 (patch) | |
tree | fbdae8333ac916715076d3bc41ed25bcd3810bfb /lib/api/issues.rb | |
parent | 5a75aa59dbafc8f0c25800f952df1e0aaa2d4dd5 (diff) | |
parent | 062efe4f7a83fb2b6d951b314692cca9ee8731cd (diff) | |
download | gitlab-ce-3781cbe0c3e56067ce60f63f83d7e3d292a03403.tar.gz |
Merge branch 'sh-optimize-todos-api' into 'master'
Significantly reduce N+1 queries in /api/v4/todos endpoint
Closes #40378
See merge request gitlab-org/gitlab-ce!25711
Diffstat (limited to 'lib/api/issues.rb')
-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 d59d2f5a098..b2ec4ed898e 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -28,7 +28,7 @@ module API args[:scope] = args[:scope].underscore if args[:scope] issues = IssuesFinder.new(current_user, args).execute - .preload(:assignees, :labels, :notes, :timelogs, :project, :author, :closed_by) + .with_api_entity_associations issues.reorder(order_options_with_tie_breaker) end # rubocop: enable CodeReuse/ActiveRecord |