diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-12-05 14:17:42 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-12-06 14:13:21 +0100 |
commit | d865aedafc2282f898b4bd2fdfd3660c47203c37 (patch) | |
tree | 7d0767215b56c61e07380e5d2985e2f7ed72b077 /app/models/commit_status.rb | |
parent | fa1105b10b4f5dbce46bd72eb6374fe7f8d51f56 (diff) | |
download | gitlab-ce-d865aedafc2282f898b4bd2fdfd3660c47203c37.tar.gz |
Introduce `Ci::Stage`, right now this is artificial object that is build dynamically.
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index d9021a38ce3..2a537dc2a13 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -41,8 +41,8 @@ class CommitStatus < ActiveRecord::Base where("#{quoted_when} <> ? OR status <> ?", 'on_failure', 'skipped') end - scope :latest_ci_stages, -> { latest.ordered.includes(project: :namespace) } - scope :retried_ci_stages, -> { retried.ordered.includes(project: :namespace) } + scope :latest_ordered, -> { latest.ordered.includes(project: :namespace) } + scope :retried_ordered, -> { retried.ordered.includes(project: :namespace) } state_machine :status do event :enqueue do @@ -117,11 +117,6 @@ class CommitStatus < ActiveRecord::Base name.gsub(/\d+[\s:\/\\]+\d+\s*/, '').strip end - def self.stages - # We group by stage name, but order stages by theirs' index - unscoped.from(all, :sg).group('stage').order('max(stage_idx)', 'stage').select('sg.stage') - end - def failed_but_allowed? allow_failure? && (failed? || canceled?) end |