diff options
author | Felipe Artur <felipefac@gmail.com> | 2017-07-10 14:57:16 -0300 |
---|---|---|
committer | Felipe Artur <felipefac@gmail.com> | 2017-07-10 14:59:34 -0300 |
commit | 0f7cb967839c6b939f6a8ce8d15c6925acb41031 (patch) | |
tree | 680a14badab4f4e10f3690d2bdf8f46b0386a993 /app/services/milestones | |
parent | 31ada792621f17ab7f4f7475405ddd1ec9e9673a (diff) | |
download | gitlab-ce-0f7cb967839c6b939f6a8ce8d15c6925acb41031.tar.gz |
Fix milestones destroy servicefix_milestone_destroy_service
Diffstat (limited to 'app/services/milestones')
-rw-r--r-- | app/services/milestones/destroy_service.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/services/milestones/destroy_service.rb b/app/services/milestones/destroy_service.rb index e457212508f..600ebcfbecb 100644 --- a/app/services/milestones/destroy_service.rb +++ b/app/services/milestones/destroy_service.rb @@ -1,15 +1,17 @@ module Milestones class DestroyService < Milestones::BaseService def execute(milestone) + return unless milestone.is_project_milestone? + Milestone.transaction do update_params = { milestone: nil } milestone.issues.each do |issue| - Issues::UpdateService.new(project, current_user, update_params).execute(issue) + Issues::UpdateService.new(parent, 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) + MergeRequests::UpdateService.new(parent, current_user, update_params).execute(merge_request) end event_service.destroy_milestone(milestone, current_user) |