summaryrefslogtreecommitdiff
path: root/lib/api/commits.rb
diff options
context:
space:
mode:
authorMartin Luder <maser@winterfell.ch>2015-05-08 14:34:10 +0200
committerMartin Luder <maser@winterfell.ch>2015-05-08 14:34:10 +0200
commit55f91f3d4348e1d7be0953d0ddf9984d65f18993 (patch)
tree0baed0bedb28b1acd015b100c69a7b3a1efa1cce /lib/api/commits.rb
parent6c32abc5f7f090d4932054e5cc1ff0594edd5ff1 (diff)
downloadgitlab-ce-55f91f3d4348e1d7be0953d0ddf9984d65f18993.tar.gz
Order commit comments in API chronologically
When fetching commit comments via API, the comments were not ordered, but just returned in the order Postgresql finds them. Now the API always returns comments in chronological order.
Diffstat (limited to 'lib/api/commits.rb')
-rw-r--r--lib/api/commits.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/api/commits.rb b/lib/api/commits.rb
index 23270b1c0f4..f4efb651eb6 100644
--- a/lib/api/commits.rb
+++ b/lib/api/commits.rb
@@ -62,7 +62,7 @@ module API
sha = params[:sha]
commit = user_project.commit(sha)
not_found! 'Commit' unless commit
- notes = Note.where(commit_id: commit.id)
+ notes = Note.where(commit_id: commit.id).order(:created_at)
present paginate(notes), with: Entities::CommitNote
end