Commit eed9f5cb authored by drew cimino's avatar drew cimino

Neater syntax for Badge::Coverage::Report#raw_coverage

parent 9b55c1fa
......@@ -45,11 +45,14 @@ module Gitlab
end
def raw_coverage
if @job.present?
@project.builds.latest.success.for_ref(@ref).by_name(@job).order_id_desc.first&.coverage
else
@project.ci_pipelines.latest_successful_for_ref(@ref)&.coverage
end
latest =
if @job.present?
@project.builds.latest.success.for_ref(@ref).by_name(@job).order_id_desc.first
else
@project.ci_pipelines.latest_successful_for_ref(@ref)
end
latest&.coverage
end
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