summaryrefslogtreecommitdiff
path: root/app/models/ci/commit.rb
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <mail@zjvandeweg.nl>2015-11-02 17:27:38 +0100
committerZeger-Jan van de Weg <mail@zjvandeweg.nl>2015-11-02 17:27:38 +0100
commit77f8a1e392b64f51326df8aebdc77e97af07bfed (patch)
treef1ce42885c2459c9e4737d8a8b5099fbdc2efa7b /app/models/ci/commit.rb
parent8c9e1df98eb45e3305ab5badc6727580e84d36e0 (diff)
downloadgitlab-ce-77f8a1e392b64f51326df8aebdc77e97af07bfed.tar.gz
Merge when build succeeds
Diffstat (limited to 'app/models/ci/commit.rb')
-rw-r--r--app/models/ci/commit.rb8
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