Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-05-11 22:12:04 +0300
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-05-30 17:55:08 +0300
commitfbd3b3d8a245072121784df11b7b41d3257b989f (patch)
tree53fd84be85bd74545d59433b1b5fcf61f5d4910e /app
parenta16cbab3bb371941f51c3c4178b8b807de000ca8 (diff)
Add API support for pipeline schedule
Diffstat (limited to 'app')
-rw-r--r--app/models/ci/pipeline_schedule.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/ci/pipeline_schedule.rb b/app/models/ci/pipeline_schedule.rb
index 07213ca608a..58cf62513d3 100644
--- a/app/models/ci/pipeline_schedule.rb
+++ b/app/models/ci/pipeline_schedule.rb
@@ -40,6 +40,10 @@ 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