summaryrefslogtreecommitdiff
path: root/app/models/merge_request.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-11-07 17:11:37 +0100
committerDouwe Maan <douwe@selenight.nl>2017-11-08 12:22:11 +0100
commitfec48c6e170fb0032cece5d8cc3b06bb45caee57 (patch)
treefc281a6272bc9f0670b01cea1134bda123435907 /app/models/merge_request.rb
parentdc1e6b436268c00bd1fdf3d15597a4656e029b95 (diff)
downloadgitlab-ce-fec48c6e170fb0032cece5d8cc3b06bb45caee57.tar.gz
Use Commit#notes and Note.for_commit_id when possible to make sure we use all the indexes available to usdm-notes-for-commit-id
Diffstat (limited to 'app/models/merge_request.rb')
-rw-r--r--app/models/merge_request.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index f80601f3484..919391d2e47 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -578,7 +578,7 @@ class MergeRequest < ActiveRecord::Base
commit_notes = Note
.except(:order)
.where(project_id: [source_project_id, target_project_id])
- .where(noteable_type: 'Commit', commit_id: commit_ids)
+ .for_commit_id(commit_ids)
# We're using a UNION ALL here since this results in better performance
# compared to using OR statements. We're using UNION ALL since the queries