summaryrefslogtreecommitdiff
path: root/app/serializers/analytics_build_entity.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-12-14 19:24:31 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-12-14 19:24:31 +0800
commit367024f1707ebbf986e5f25ac208f24e35746389 (patch)
tree8ff45ed585720aa4eb2f5a6c772a2a20f89b946f /app/serializers/analytics_build_entity.rb
parent101cde38cf6d5506ea37c5f912fb4c37af50c541 (diff)
parent3a90612660ab90225907ec6d79032905885c2507 (diff)
downloadgitlab-ce-367024f1707ebbf986e5f25ac208f24e35746389.tar.gz
Merge remote-tracking branch 'upstream/master' into show-commit-status-from-latest-pipeline
* upstream/master: (557 commits) Fix wrong error message expectation in API::Commits spec Move admin settings spinach feature to rspec Encode when migrating ProcessCommitWorker jobs Prevent overflow with vertical scroll when we have space to show content Make rubocop happy API: Ability to cherry-pick a commit Be smarter when finding a sudoed user in API::Helpers Backport hooks on group policies for the EE-specific implementation API: Ability to get group's project in simple representation Add AddLowerPathIndexToRoutes to setup_postgresql.rake For single line git commit messages, the close quote should be on the same line as the open quote added border-radius and padding to labels Allow all alphanumeric characters in file names (!8002) Add failing test for #20190 Don't allow blank MR titles in API Replace static fixture for awards_handler_spec (!7661) Crontab typo '* */6' -> '0 */6' (4x/day not 1x-per-min-for-1h 4x/day) Fix test Tweak style and add back wording Clean up commit copy to clipboard and make consistent ...
Diffstat (limited to 'app/serializers/analytics_build_entity.rb')
-rw-r--r--app/serializers/analytics_build_entity.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/serializers/analytics_build_entity.rb b/app/serializers/analytics_build_entity.rb
index abefcd5cc02..a0db5b8f0f4 100644
--- a/app/serializers/analytics_build_entity.rb
+++ b/app/serializers/analytics_build_entity.rb
@@ -13,7 +13,7 @@ class AnalyticsBuildEntity < Grape::Entity
end
expose :duration, as: :total_time do |build|
- distance_of_time_as_hash(build.duration.to_f)
+ build.duration ? distance_of_time_as_hash(build.duration.to_f) : {}
end
expose :branch do