diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/models/group_milestone.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'app/models/group_milestone.rb')
-rw-r--r-- | app/models/group_milestone.rb | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/app/models/group_milestone.rb b/app/models/group_milestone.rb deleted file mode 100644 index 60e97174e50..00000000000 --- a/app/models/group_milestone.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true -# Group Milestones are milestones that can be shared among many projects within the same group -class GroupMilestone < GlobalMilestone - attr_reader :group, :milestones - - def self.build_collection(group, projects, params) - params = - { state: params[:state], search_title: params[:search_title] } - - project_milestones = Milestone.of_projects(projects) - project_milestones = project_milestones.search_title(params[:search_title]) if params[:search_title].present? - child_milestones = Milestone.filter_by_state(project_milestones, params[:state]) - grouped_milestones = child_milestones.group_by(&:title) - - grouped_milestones.map do |title, grouped| - new(title, grouped, group) - end - end - - def self.build(group, projects, title) - child_milestones = Milestone.of_projects(projects).where(title: title) - return if child_milestones.blank? - - new(title, child_milestones, group) - end - - def initialize(title, milestones, group) - @milestones = milestones - @group = group - end - - def milestone - @milestone ||= milestones.find { |m| m.description.present? } || milestones.first - end - - def issues_finder_params - { group_id: group.id } - end - - def legacy_group_milestone? - true - end - - def merge_requests_enabled? - true - end -end - -GroupMilestone.include_if_ee('::EE::GroupMilestone') |