Skip to content
Snippets Groups Projects
Commit f8cb5fd6 authored by Shinya Maeda's avatar Shinya Maeda
Browse files

Add own! method on PipleineSchedule

parent 8743f765
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -24,6 +24,10 @@ module Ci
owner == current_user
end
 
def own!(user)
update!(owner: user)
end
def inactive?
!active?
end
Loading
Loading
Loading
Loading
@@ -100,7 +100,7 @@ module API
pipeline_schedule = user_project.pipeline_schedules.find(params.delete(:pipeline_schedule_id))
return not_found!('PipelineSchedule') unless pipeline_schedule
 
if pipeline_schedule.update(owner: current_user)
if pipeline_schedule.own!(current_user)
status :ok
present pipeline_schedule, with: Entities::PipelineSchedule
else
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment