summaryrefslogtreecommitdiff
path: root/app/models/commit_status.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-24 11:33:01 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-24 11:33:01 +0200
commit8657d5dd8af6c365b41d7c2997e6e5c9e18e8241 (patch)
tree3d7918aafff40e28f29e7c8bfaaa421c8a75ec17 /app/models/commit_status.rb
parentd3814ad69876c69cdab574e2958368f2ab648171 (diff)
downloadgitlab-ce-8657d5dd8af6c365b41d7c2997e6e5c9e18e8241.tar.gz
Do not implement CI/CD job to stage association yet
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r--app/models/commit_status.rb15
1 files changed, 4 insertions, 11 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb
index efb5cbd9d41..d7418a07177 100644
--- a/app/models/commit_status.rb
+++ b/app/models/commit_status.rb
@@ -38,22 +38,15 @@ class CommitStatus < ActiveRecord::Base
scope :retried_ordered, -> { retried.ordered.includes(project: :namespace) }
scope :after_stage, -> (index) { where('stage_idx > ?', index) }
- ##
- # TODO, we will change this to `belongs_to :stage` when we phase out
- # `ci_builds.stage` attribute and migrate `ci_builds.stage_id` reference in
- # one of upcoming releases.
- #
- belongs_to :stage_entity, foreign_key: :stage_id, class_name: 'Ci::Stage'
-
state_machine :status do
- event :enqueue do
- transition [:created, :skipped, :manual] => :pending
- end
-
event :process do
transition [:skipped, :manual] => :created
end
+ event :enqueue do
+ transition [:created, :skipped, :manual] => :pending
+ end
+
event :run do
transition pending: :running
end