diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-13 03:10:16 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-30 23:55:08 +0900 |
commit | 8743f765abc2281c664792f5016747f54d0fb7aa (patch) | |
tree | b5681f9bd4fe7c29b81e8a2e7e62ac240a2cce9c | |
parent | 97bf2401991ab2e9cea956dfb7c9630e2a185683 (diff) | |
download | gitlab-ce-8743f765abc2281c664792f5016747f54d0fb7aa.tar.gz |
Use CreatePipelineScheduleService
-rw-r--r-- | lib/api/pipeline_schedules.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/api/pipeline_schedules.rb b/lib/api/pipeline_schedules.rb index 5b3af090e2b..6e6bbb29e3a 100644 --- a/lib/api/pipeline_schedules.rb +++ b/lib/api/pipeline_schedules.rb @@ -51,8 +51,9 @@ module API authenticate! authorize! :create_pipeline_schedule, user_project - pipeline_schedule = user_project.pipeline_schedules.create( - declared_params(include_missing: false).merge(owner: current_user)) + pipeline_schedule = Ci::CreatePipelineScheduleService + .new(user_project, current_user, declared_params(include_missing: false)) + .execute if pipeline_schedule.valid? present pipeline_schedule, with: Entities::PipelineSchedule |