diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-11-19 15:46:04 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-11-19 15:46:04 +0100 |
commit | f5a630111fb1499a1541e77040529f74ca6475ec (patch) | |
tree | c3c82cd23d7bdcbfe4ec38d12be4572a6e8653ee /app/models/commit_status.rb | |
parent | 28af56dea5a88ffcaceb082cf67c9c1ab021609d (diff) | |
parent | c8074b6b115c95c68d5f7df300a391b4eab521d5 (diff) | |
download | gitlab-ce-f5a630111fb1499a1541e77040529f74ca6475ec.tar.gz |
Merge branch 'master' into reference-pipeline-and-caching
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 0b73ab6d2eb..e70f4d37184 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -1,3 +1,36 @@ +# == Schema Information +# +# 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 +# + class CommitStatus < ActiveRecord::Base self.table_name = 'ci_builds' @@ -15,8 +48,8 @@ class CommitStatus < ActiveRecord::Base scope :pending, -> { where(status: 'pending') } scope :success, -> { where(status: 'success') } scope :failed, -> { where(status: 'failed') } - scope :running_or_pending, -> { where(status:[:running, :pending]) } - scope :finished, -> { where(status:[:success, :failed, :canceled]) } + scope :running_or_pending, -> { where(status: [:running, :pending]) } + scope :finished, -> { where(status: [:success, :failed, :canceled]) } scope :latest, -> { where(id: unscope(:select).select('max(id)').group(:name, :ref)) } scope :ordered, -> { order(:ref, :stage_idx, :name) } scope :for_ref, ->(ref) { where(ref: ref) } @@ -92,4 +125,8 @@ class CommitStatus < ActiveRecord::Base def show_warning? false end + + def download_url + nil + end end |