gitlab-org--gitlab-foss/app/services/milestones/create_service.rb
Mark Fletcher 58d02520b0 Ensure validation messages are shown within the milestone form
* Remove call to Milestone#save! instead just Milestone#save
* Add safety specs to stop a regression

Fixes #22033
2016-09-19 09:29:12 +01:00

13 lines
263 B
Ruby

module Milestones
class CreateService < Milestones::BaseService
def execute
milestone = project.milestones.new(params)
if milestone.save
event_service.open_milestone(milestone, current_user)
end
milestone
end
end
end