diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-11-10 15:32:23 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-12-06 14:13:21 +0100 |
commit | 4e06818d330b4f15f334561500d506f0d24b9dfe (patch) | |
tree | 9cefe7b54824f995d715dc03b5ae4b68978cd21f /app/models/commit_status.rb | |
parent | 532c031915597a660ab21de0cd11f8255e54c03d (diff) | |
download | gitlab-ce-4e06818d330b4f15f334561500d506f0d24b9dfe.tar.gz |
Support pipelines API
Pass `updated_at` to get only incremental changes since last update
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index c345bf293c9..d9021a38ce3 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -119,16 +119,7 @@ class CommitStatus < ActiveRecord::Base 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').pluck('sg.stage') - end - - def self.stages_status - # We execute subquery for each stage to calculate a stage status - statuses = unscoped.from(all, :sg).group('stage').pluck('sg.stage', all.where('stage=sg.stage').status_sql) - statuses.inject({}) do |h, k| - h[k.first] = k.last - h - end + unscoped.from(all, :sg).group('stage').order('max(stage_idx)', 'stage').select('sg.stage') end def failed_but_allowed? |