summaryrefslogtreecommitdiff
path: root/app/models/ci/pipeline.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/ci/pipeline.rb')
-rw-r--r--app/models/ci/pipeline.rb20
1 files changed, 7 insertions, 13 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 6820b2d41a7..d00de56bf07 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -20,7 +20,7 @@ module Ci
after_save :keep_around_commits
state_machine :status, initial: :created do
- event :queue do
+ event :enqueue do
transition created: :pending
transition any - [:created, :pending] => :running
end
@@ -224,18 +224,12 @@ module Ci
def build_updated
case latest_builds_status
- when 'pending'
- queue
- when 'running'
- run
- when 'success'
- succeed
- when 'failed'
- drop
- when 'canceled'
- cancel
- when 'skipped'
- skip
+ when 'pending' then enqueue
+ when 'running' then run
+ when 'success' then succeed
+ when 'failed' then drop
+ when 'canceled' then cancel
+ when 'skipped' then skip
end
end