Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2016-12-20 00:26:15 +0300
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2016-12-20 15:56:48 +0300
commita2f57f23616bc1ab7547e5a7c517cdd49b172bd8 (patch)
tree9e41bc2194897830e344b5265e60eaf04857cf89 /app/models/issue.rb
parent01adeb17acccab09eb0074725050356d9d431c8a (diff)
Fix N+1 queries on milestone show pages
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r--app/models/issue.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 738c96e4db3..6825553512f 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -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