Commit 18fa43da authored by Stan Hu's avatar Stan Hu Committed by Lin Jen-Shin

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

Use preload to avoid Rails using JOIN

See merge request !10666
parent 467576d4
......@@ -39,7 +39,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