debian-mirror-gitlab/app/models/dashboard_group_milestone.rb
2019-02-13 22:33:31 +05:30

21 lines
580 B
Ruby

# frozen_string_literal: true
# Dashboard Group Milestones are milestones that allow us to pull more info out for the UI that the Milestone object doesn't allow for
class DashboardGroupMilestone < GlobalMilestone
extend ::Gitlab::Utils::Override
attr_reader :group_name
def initialize(milestone)
super
@group_name = milestone.group.full_name
end
def self.build_collection(groups)
Milestone.of_groups(groups.select(:id))
.reorder_by_due_date_asc
.order_by_name_asc
.active
.map { |m| new(m) }
end
end