summaryrefslogtreecommitdiff
path: root/app/models/issue.rb
diff options
context:
space:
mode:
authorJames Edwards-Jones <jedwardsjones@gitlab.com>2016-12-19 21:26:15 +0000
committerJames Edwards-Jones <jedwardsjones@gitlab.com>2016-12-20 12:56:48 +0000
commita2f57f23616bc1ab7547e5a7c517cdd49b172bd8 (patch)
tree9e41bc2194897830e344b5265e60eaf04857cf89 /app/models/issue.rb
parent01adeb17acccab09eb0074725050356d9d431c8a (diff)
downloadgitlab-ce-a2f57f23616bc1ab7547e5a7c517cdd49b172bd8.tar.gz
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