diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-07 14:52:13 +0200 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-09-07 14:52:13 +0200 |
commit | d392f147fc2b08cf3139e2cce2a264eaf0bc4a48 (patch) | |
tree | 58a2ae5d0a935545806aa3c2a7577fc86a026c3d /app/models/commit_status.rb | |
parent | 1d5488699678d22644d24add4b89cede0419ad25 (diff) | |
download | gitlab-ce-d392f147fc2b08cf3139e2cce2a264eaf0bc4a48.tar.gz |
Group similar builds
Diffstat (limited to 'app/models/commit_status.rb')
-rw-r--r-- | app/models/commit_status.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/commit_status.rb b/app/models/commit_status.rb index 4a628924499..af739342256 100644 --- a/app/models/commit_status.rb +++ b/app/models/commit_status.rb @@ -95,6 +95,10 @@ class CommitStatus < ActiveRecord::Base pipeline.before_sha || Gitlab::Git::BLANK_SHA end + def group_name + name.gsub(/\d+[\s:]+\d+\s*/, '') + 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').pluck('sg.stage') |