Commit 6ce2cc61 authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-preloading-merge_request_diff' into 'master'

Use preload to avoid Rails using JOIN

See merge request !10666
parents 0fa00e84 2263ce97
......@@ -38,7 +38,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@collection_type = "MergeRequest"
@merge_requests = merge_requests_collection
@merge_requests = @merge_requests.page(params[:page])
@merge_requests = @merge_requests.includes(merge_request_diff: :merge_request)
@merge_requests = @merge_requests.preload(merge_request_diff: :merge_request)
@issuable_meta_data = issuable_meta_data(@merge_requests, @collection_type)
if @merge_requests.out_of_range? && @merge_requests.total_pages != 0
......
---
title: Fix bad query for PostgreSQL showing merge requests list
merge_request: 10666
author:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment