diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-10 02:38:25 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-05-10 02:38:25 +0300 |
commit | 3953e5fcd7060e77405327e670f92ebd7d0ee5a0 (patch) | |
tree | ca3992f88a928deb9bdfd7fe5f79985878158f19 /app/models | |
parent | fe2137d871b978033007a3375cf6f1edf0f04cd4 (diff) | |
download | gitlab-ce-3953e5fcd7060e77405327e670f92ebd7d0ee5a0.tar.gz |
Update generic commit status to make it look like a build
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/commit_status.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 0c0c3d38f94..2d09edf3ca1 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -91,12 +91,12 @@ class CommitStatus < ActiveRecord::Base end def self.stages - # We group by stage name, but order stages by their's index + # 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 of the stages which calculates an Stage 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 |