Commit a32dd93a authored by James Lopez's avatar James Lopez

fix started_at check

parent 94a74e79
......@@ -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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment