Fix N+1 queries on milestone show pages

This commit is contained in:
James Edwards-Jones 2016-12-19 21:26:15 +00:00
parent 01adeb17ac
commit a2f57f2361
3 changed files with 7 additions and 1 deletions

View file

@ -39,6 +39,8 @@ class Issue < ActiveRecord::Base
scope :created_after, -> (datetime) { where("created_at >= ?", datetime) }
scope :include_associations, -> { includes(:assignee, :labels, project: :namespace) }
attr_spammable :title, spam_title: true
attr_spammable :description, spam_description: true

View file

@ -21,7 +21,7 @@
.tab-content.milestone-content
.tab-pane.active#tab-issues
= render 'shared/milestones/issues_tab', issues: milestone.issues_visible_to_user(current_user), show_project_name: show_project_name, show_full_project_name: show_full_project_name
= render 'shared/milestones/issues_tab', issues: milestone.issues_visible_to_user(current_user).include_associations, show_project_name: show_project_name, show_full_project_name: show_full_project_name
.tab-pane#tab-merge-requests
= render 'shared/milestones/merge_requests_tab', merge_requests: milestone.merge_requests, show_project_name: show_project_name, show_full_project_name: show_full_project_name
.tab-pane#tab-participants

View file

@ -0,0 +1,4 @@
---
title: Fix N+1 queries on milestone show pages
merge_request: 8185
author: