diff options
author | Stan Hu <stanhu@gmail.com> | 2015-09-18 08:39:19 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-09-21 07:00:55 -0700 |
commit | ea5c25bb4ed46decde33c86e618f0b18dd55dae3 (patch) | |
tree | d89f757d60ca9a599405d83c51f126f7d30ca4f0 /app/services/milestones | |
parent | abaa65efc1f912ffef05ccaf1e92dc009f828278 (diff) | |
download | gitlab-ce-ea5c25bb4ed46decde33c86e618f0b18dd55dae3.tar.gz |
Remove milestones from merge requests when milestones are deleted
Reported by https://github.com/gitlabhq/gitlabhq/issues/9643
Diffstat (limited to 'app/services/milestones')
-rw-r--r-- | app/services/milestones/destroy_service.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/services/milestones/destroy_service.rb b/app/services/milestones/destroy_service.rb index 7ce7d259d0b..2414966505b 100644 --- a/app/services/milestones/destroy_service.rb +++ b/app/services/milestones/destroy_service.rb @@ -4,10 +4,15 @@ module Milestones Milestone.transaction do update_params = { milestone: nil } + milestone.issues.each do |issue| Issues::UpdateService.new(project, current_user, update_params).execute(issue) end + milestone.merge_requests.each do |merge_request| + MergeRequests::UpdateService.new(project, current_user, update_params).execute(merge_request) + end + event_service.destroy_milestone(milestone, current_user) Event.for_milestone_id(milestone.id).each do |event| |