diff options
author | Zeger-Jan van de Weg <mail@zjvandeweg.nl> | 2015-11-02 17:27:38 +0100 |
---|---|---|
committer | Zeger-Jan van de Weg <mail@zjvandeweg.nl> | 2015-11-02 17:27:38 +0100 |
commit | 77f8a1e392b64f51326df8aebdc77e97af07bfed (patch) | |
tree | f1ce42885c2459c9e4737d8a8b5099fbdc2efa7b /app/models/ci/commit.rb | |
parent | 8c9e1df98eb45e3305ab5badc6727580e84d36e0 (diff) | |
download | gitlab-ce-77f8a1e392b64f51326df8aebdc77e97af07bfed.tar.gz |
Merge when build succeeds
Diffstat (limited to 'app/models/ci/commit.rb')
-rw-r--r-- | app/models/ci/commit.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 13437b2483f..ebe4bace3b5 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -164,6 +164,14 @@ module Ci status == 'canceled' end + def active? + running? || pending? + end + + def complete? + canceled? || success? || failed? + end + def duration duration_array = latest_statuses.map(&:duration).compact duration_array.reduce(:+).to_i |