From a78eeefd6e76c956751a2a7f03efeaee28f83b46 Mon Sep 17 00:00:00 2001 From: Jeff Stubler Date: Tue, 25 Oct 2016 19:03:42 -0500 Subject: Change issues sentence to use natural sorting --- app/helpers/merge_requests_helper.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/helpers/merge_requests_helper.rb b/app/helpers/merge_requests_helper.rb index 38be073c8dc..e347f61fb8d 100644 --- a/app/helpers/merge_requests_helper.rb +++ b/app/helpers/merge_requests_helper.rb @@ -56,11 +56,12 @@ module MergeRequestsHelper end def issues_sentence(issues) - # Sorting based on the `#123` or `group/project#123` reference will sort - # local issues first. - issues.map do |issue| + # Issuable sorter will sort local issues, then issues from the same + # namespace, then all other issues. + issues = Gitlab::IssuableSorter.sort(@project, issues).map do |issue| issue.to_reference(@project) - end.sort.to_sentence + end + issues.to_sentence end def mr_closes_issues -- cgit v1.2.1