2014-06-10 11:07:52 -04:00
|
|
|
module Milestones
|
|
|
|
class CreateService < Milestones::BaseService
|
|
|
|
def execute
|
2017-07-07 11:08:49 -04:00
|
|
|
milestone = parent.milestones.new(params)
|
2014-06-10 11:07:52 -04:00
|
|
|
|
2017-08-24 12:37:37 -04:00
|
|
|
if milestone.save && milestone.project_milestone?
|
2014-06-10 11:07:52 -04:00
|
|
|
event_service.open_milestone(milestone, current_user)
|
|
|
|
end
|
|
|
|
|
|
|
|
milestone
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|