summaryrefslogtreecommitdiff
path: root/app/models/ci/commit.rb
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-12-09 13:56:26 +0100
committerDouwe Maan <douwe@gitlab.com>2015-12-09 13:56:26 +0100
commit73c59de0621010681197ebe7bfaed7f3eb03050d (patch)
treef84dcde56073325ea98116f04e0f3710913291e3 /app/models/ci/commit.rb
parent6c6fb1d8bb2c6aa44553ebf35496d64ff6b202d2 (diff)
parent9bfd6c44e23754b6f699586f6a0cec2879e107e0 (diff)
downloadgitlab-ce-73c59de0621010681197ebe7bfaed7f3eb03050d.tar.gz
Merge branch 'master' into split-up-builds
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 cb90b0de63d..75465685e98 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -165,6 +165,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