diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-11-07 17:11:37 +0100 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-11-08 12:22:11 +0100 |
commit | fec48c6e170fb0032cece5d8cc3b06bb45caee57 (patch) | |
tree | fc281a6272bc9f0670b01cea1134bda123435907 /lib/api | |
parent | dc1e6b436268c00bd1fdf3d15597a4656e029b95 (diff) | |
download | gitlab-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')
-rw-r--r-- | lib/api/commits.rb | 2 | ||||
-rw-r--r-- | lib/api/v3/commits.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/commits.rb b/lib/api/commits.rb index 2685dc27252..2bc4039b019 100644 --- a/lib/api/commits.rb +++ b/lib/api/commits.rb @@ -117,7 +117,7 @@ module API commit = user_project.commit(params[:sha]) not_found! 'Commit' unless commit - notes = user_project.notes.where(commit_id: commit.id).order(:created_at) + notes = commit.notes.order(:created_at) present paginate(notes), with: Entities::CommitNote end 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 |