diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-11-17 14:33:35 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-11-17 14:33:35 +0100 |
commit | 7b014338ca94caf4677a035f28469945e6a80100 (patch) | |
tree | c442bdae95edb35d14551ca04052227bdb840511 /app/models/commit_status.rb | |
parent | bb8b6f38e7fef0afd41088d54d9dda41695ec1c7 (diff) | |
parent | 1c040b3f0a3ecb18fc8fdea3cf99b70edad8d873 (diff) | |
download | gitlab-ce-contributor-graph-by-email.tar.gz |
Merge branch 'master' into contributor-graph-by-emailcontributor-graph-by-email
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 |