提交 a32dd93a 编写于 作者: J James Lopez

fix started_at check

上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册