summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-09-18 16:11:24 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2017-09-18 16:11:24 +0000
commit9b13753302df7a3e8ef86c6af3f84066bde31a21 (patch)
treec362b53b0d8dbcdb448f357f52e7f3d5389cb893 /app/controllers
parentcffb325ec05eefb29f8ee93e543fd75605743f55 (diff)
parent8690ca5c2857da39c8f5839b9383931ee026f559 (diff)
downloadgitlab-ce-9b13753302df7a3e8ef86c6af3f84066bde31a21.tar.gz
Merge branch 'sh-optimize-discussion-json' into 'master'
Eliminate N+1 queries in loading discussions.json endpoint Closes #37955 See merge request gitlab-org/gitlab-ce!14327
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/issues_controller.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb
index 8990c919ca0..42bfa4b9d4f 100644
--- a/app/controllers/projects/issues_controller.rb
+++ b/app/controllers/projects/issues_controller.rb
@@ -87,9 +87,9 @@ class Projects::IssuesController < Projects::ApplicationController
.inc_relations_for_view
.includes(:noteable)
.fresh
- .reject { |n| n.cross_reference_not_visible_for?(current_user) }
- prepare_notes_for_rendering(notes)
+ notes = prepare_notes_for_rendering(notes)
+ notes = notes.reject { |n| n.cross_reference_not_visible_for?(current_user) }
discussions = Discussion.build_collection(notes, @issue)