diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-02-13 17:39:09 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-02-13 17:39:09 +0300 |
commit | 16908f9718820dd651faa61396fedb997d10eadd (patch) | |
tree | 0137c0898875262caa4f541883f84970ce20a22c /app/services | |
parent | de67c5972084847c1517d1cf9e347cdb39a1a1ae (diff) | |
parent | 9abbe3cc860f5838df76405e59830efdacb07047 (diff) |
Merge branch '26466-natural-sort-mrs' into 'master'
Group MR numbers on issue show page by project and namespace
Closes #26466
See merge request gitlab-org/gitlab-ce!8494
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/issues/fetch_referenced_merge_requests_service.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/services/issues/fetch_referenced_merge_requests_service.rb b/app/services/issues/fetch_referenced_merge_requests_service.rb new file mode 100644 index 00000000000..39c8ded9df4 --- /dev/null +++ b/app/services/issues/fetch_referenced_merge_requests_service.rb @@ -0,0 +1,12 @@ +module Issues + class FetchReferencedMergeRequestsService < Issues::BaseService + def execute(issue) + referenced_merge_requests = issue.referenced_merge_requests(current_user) + referenced_merge_requests = Gitlab::IssuableSorter.sort(project, referenced_merge_requests) { |i| i.iid.to_s } + closed_by_merge_requests = issue.closed_by_merge_requests(current_user) + closed_by_merge_requests = Gitlab::IssuableSorter.sort(project, closed_by_merge_requests) { |i| i.iid.to_s } + + [referenced_merge_requests, closed_by_merge_requests] + end + end +end |