debian-mirror-gitlab/app/services/milestones/update_service.rb
2017-09-10 17:25:29 +05:30

20 lines
498 B
Ruby

module Milestones
class UpdateService < Milestones::BaseService
def execute(milestone)
state = params[:state_event]
case state
when 'activate'
Milestones::ReopenService.new(parent, current_user, {}).execute(milestone)
when 'close'
Milestones::CloseService.new(parent, current_user, {}).execute(milestone)
end
if params.present?
milestone.update_attributes(params.except(:state_event))
end
milestone
end
end
end