diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2018-09-17 13:35:39 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2018-09-18 11:35:21 -0300 |
commit | ec14d3fe3432b103230ec2c1f16678cf71236fbe (patch) | |
tree | 4684959e077b842e0e00c2351f710ab76053bf66 /app/models/dashboard_group_milestone.rb | |
parent | a2a00a5e6d1ba3d2ebfafcff57e211cb1b65c00a (diff) | |
download | gitlab-ce-ec14d3fe3432b103230ec2c1f16678cf71236fbe.tar.gz |
Don't use MilestoneFinder for group milestones
This refactors the DashboardGroupMilestone model so that it no
longer uses the MilestoneFinder, instead using methods defined
on the Milestone model directly.
Diffstat (limited to 'app/models/dashboard_group_milestone.rb')
-rw-r--r-- | app/models/dashboard_group_milestone.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/models/dashboard_group_milestone.rb b/app/models/dashboard_group_milestone.rb index 067e14dda1c..32e8104125c 100644 --- a/app/models/dashboard_group_milestone.rb +++ b/app/models/dashboard_group_milestone.rb @@ -13,7 +13,11 @@ class DashboardGroupMilestone < GlobalMilestone end def self.build_collection(groups) - MilestonesFinder.new(group_ids: groups.select(:id)).execute.map { |m| new(m) } # rubocop: disable CodeReuse/Finder + Milestone.of_groups(groups.select(:id)) + .reorder_by_due_date_asc + .order_by_name_asc + .active + .map { |m| new(m) } end override :group_milestone? |