summaryrefslogtreecommitdiff
path: root/lib/api/v3
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 /lib/api/v3
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 'lib/api/v3')
-rw-r--r--lib/api/v3/commits.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/v3/commits.rb b/lib/api/v3/commits.rb
index ed206a6def0..be360fbfc0c 100644
--- a/lib/api/v3/commits.rb
+++ b/lib/api/v3/commits.rb
@@ -106,7 +106,7 @@ module API
commit = user_project.commit(params[:sha])
not_found! 'Commit' unless commit
- notes = Note.where(commit_id: commit.id).order(:created_at)
+ notes = commit.notes.order(:created_at)
present paginate(notes), with: ::API::Entities::CommitNote
end