Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-11-29 14:41:11 +0300
committerJames Lopez <james@jameslopez.es>2016-11-29 14:41:11 +0300
commita32dd93a4c5c0ae647beac425ed23e4b9c3d27f2 (patch)
tree8a37014213eae4978835774586faf88aeadb5009 /app/serializers
parent94a74e79cb087cc499add60ab638d999bc7e3815 (diff)
fix started_at check
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/analytics_build_entity.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/serializers/analytics_build_entity.rb b/app/serializers/analytics_build_entity.rb
index 206a7eadbcf..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|
- build_started?(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
@@ -37,8 +37,4 @@ class AnalyticsBuildEntity < Grape::Entity
def url_to(route, build, id = nil)
public_send("#{route}_url", build.project.namespace, build.project, id || build)
end
-
- def build_started?(build)
- build.duration && build[:started_at]
- end
end