diff options
author | Sean McGivern <sean@gitlab.com> | 2017-08-03 20:50:52 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-08-07 13:55:01 +0300 |
commit | 76b80d6e96bd003de7d46736eb7b6d2de98df1a1 (patch) | |
tree | a1dfc0d2e80058829d533f0645f74014cea59518 /app/services | |
parent | ca923d48998294d0903d47aa613862a873341bf1 (diff) |
Show group milestones in autocomplete
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/projects/autocomplete_service.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/services/projects/autocomplete_service.rb b/app/services/projects/autocomplete_service.rb index fc85f398935..724a77c873a 100644 --- a/app/services/projects/autocomplete_service.rb +++ b/app/services/projects/autocomplete_service.rb @@ -5,7 +5,15 @@ module Projects end def milestones - @project.milestones.active.reorder(due_date: :asc, title: :asc).select([:iid, :title]) + finder_params = { + project_ids: [@project.id], + state: :active, + order: { due_date: :asc, title: :asc } + } + + finder_params[:group_ids] = [@project.group.id] if @project.group + + MilestonesFinder.new(finder_params).execute.select([:iid, :title]) end def merge_requests |