BigW Consortium Gitlab

Commit 94f7595b by Shinya Maeda

Define last_pipeline in PipelineScheduleEntity

parent e9298978
......@@ -44,10 +44,6 @@ module Ci
self.next_run_at = Gitlab::Ci::CronParser.new(cron, cron_timezone).next_time_from(Time.now)
end
def last_pipeline
self.pipelines&.last
end
def schedule_next_run!
save! # with set_next_run_at
rescue ActiveRecord::RecordInvalid
......
......@@ -690,7 +690,9 @@ module API
expose :id
expose :description, :ref, :cron, :cron_timezone, :next_run_at, :active
expose :created_at, :updated_at, :deleted_at
expose :last_pipeline, using: Entities::Pipeline
expose :last_pipeline, using: Entities::Pipeline do |pipeline_schedule|
pipeline_schedule.pipelines&.last
end
expose :owner, using: Entities::UserBasic
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment