From 3b61451c46f462b392783b282fe63dbddd8b6c2e Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Sat, 27 May 2017 22:31:22 +0900 Subject: Return 202 for destory. Remove []. Remove def pipeline_schedules from helper. --- lib/api/pipeline_schedules.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/api/pipeline_schedules.rb b/lib/api/pipeline_schedules.rb index 52ad682b972..d9509375698 100644 --- a/lib/api/pipeline_schedules.rb +++ b/lib/api/pipeline_schedules.rb @@ -114,20 +114,16 @@ module API not_found!('PipelineSchedule') unless pipeline_schedule + status :accepted present pipeline_schedule.destroy, with: Entities::PipelineScheduleDetails end end helpers do - def pipeline_schedules - @pipeline_schedules ||= - user_project.pipeline_schedules.preload([:owner, :last_pipeline]) - end - def pipeline_schedule @pipeline_schedule ||= user_project.pipeline_schedules - .preload([:owner, :last_pipeline]) + .preload(:owner, :last_pipeline) .find_by(id: params.delete(:pipeline_schedule_id)) end end -- cgit v1.2.3