debian-mirror-gitlab/app/models/dashboard_group_milestone.rb

23 lines
700 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# 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)
2019-02-15 15:39:39 +05:30
super
2018-11-18 11:00:15 +05:30
@group_name = milestone.group.full_name
end
2019-03-02 22:35:43 +05:30
def self.build_collection(groups, params)
milestones = Milestone.of_groups(groups.select(:id))
2018-12-05 23:21:45 +05:30
.reorder_by_due_date_asc
.order_by_name_asc
.active
2019-03-02 22:35:43 +05:30
milestones = milestones.search_title(params[:search_title]) if params[:search_title].present?
milestones.map { |m| new(m) }
2018-11-18 11:00:15 +05:30
end
end