diff options
author | Stan Hu <stanhu@gmail.com> | 2018-06-03 13:31:41 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-06-03 14:24:23 +0300 |
commit | bd4bfcc6411e4819c0c67717095bb2e54e7bb6df (patch) | |
tree | a803900600a5de61440026c0a72f75fdf61ff7d0 /lib | |
parent | fe0ebf76c49e2512b211c5d43152275c536f7e3a (diff) |
Fix N+1 with source projects in merge requests API
Now that we are checking `MergeRequest#for_fork?`, we also need
the source project preloaded for a merge request.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/merge_requests.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index b1e510d72de..278d53427f0 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -38,7 +38,7 @@ module API merge_requests = MergeRequestsFinder.new(current_user, args).execute .reorder(args[:order_by] => args[:sort]) merge_requests = paginate(merge_requests) - .preload(:target_project) + .preload(:source_project, :target_project) return merge_requests if args[:view] == 'simple' |