diff options
author | Rubén Dávila <rdavila84@gmail.com> | 2016-01-14 17:28:44 -0500 |
---|---|---|
committer | Rubén Dávila <rdavila84@gmail.com> | 2016-01-14 17:28:44 -0500 |
commit | c8db25c37c0d78457d06117497ccde7ad80e2321 (patch) | |
tree | dc2db4637c33c53b032a22f8e78975838396ed13 /app/models/commit_status.rb | |
parent | 6b9c730e91962a6d6343bcb7fc4dc75c99b41bde (diff) | |
parent | 948bb655f3cba9909b7396c3062da7b22f4409b3 (diff) | |
download | gitlab-ce-c8db25c37c0d78457d06117497ccde7ad80e2321.tar.gz |
Merge branch 'master' into issue_3945
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 63 |
1 files changed, 37 insertions, 26 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 21c5c87bc3d..66e0502fc0c 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -1,30 +1,35 @@ # == Schema Information # -# project_id integer -# status string -# finished_at datetime -# trace text -# created_at datetime -# updated_at datetime -# started_at datetime -# runner_id integer -# coverage float -# commit_id integer -# commands text -# job_id integer -# name string -# deploy boolean default: false -# options text -# allow_failure boolean default: false, null: false -# stage string -# trigger_request_id integer -# stage_idx integer -# tag boolean -# ref string -# user_id integer -# type string -# target_url string -# description string +# Table name: ci_builds +# +# id :integer not null, primary key +# project_id :integer +# status :string(255) +# finished_at :datetime +# trace :text +# created_at :datetime +# updated_at :datetime +# started_at :datetime +# runner_id :integer +# coverage :float +# commit_id :integer +# commands :text +# job_id :integer +# name :string(255) +# deploy :boolean default(FALSE) +# options :text +# allow_failure :boolean default(FALSE), not null +# stage :string(255) +# trigger_request_id :integer +# stage_idx :integer +# tag :boolean +# ref :string(255) +# user_id :integer +# type :string(255) +# target_url :string(255) +# description :string(255) +# artifacts_file :text +# gl_project_id :integer # class CommitStatus < ActiveRecord::Base @@ -51,6 +56,8 @@ class CommitStatus < ActiveRecord::Base scope :ordered, -> { order(:ref, :stage_idx, :name) } scope :for_ref, ->(ref) { where(ref: ref) } + AVAILABLE_STATUSES = ['pending', 'running', 'success', 'failed', 'canceled'] + state_machine :status, initial: :pending do event :run do transition pending: :running @@ -126,7 +133,11 @@ class CommitStatus < ActiveRecord::Base false end - def download_url + def artifacts_download_url + nil + end + + def artifacts_browse_url nil end end |