From 55f91f3d4348e1d7be0953d0ddf9984d65f18993 Mon Sep 17 00:00:00 2001 From: Martin Luder Date: Fri, 8 May 2015 14:34:10 +0200 Subject: 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. --- lib/api/commits.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/api/commits.rb') 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 -- cgit v1.2.1