From 16592e2b45d42e22f9d1d595a1f44821c7b30441 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 14 Mar 2016 13:33:26 +0100 Subject: Fix review comments - Remove unused Gitlab::Application.routes.url_helpers from Ci::Build - Remove too much logic from a view, use Ci::Commit.matrix_builds - Use ci_status_with_icon - Don't describe symbols --- app/models/ci/commit.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/models/ci/commit.rb') diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb index 12c60158d46..f4cf7034b14 100644 --- a/app/models/ci/commit.rb +++ b/app/models/ci/commit.rb @@ -113,6 +113,12 @@ module Ci latest_statuses.select { |status| status.ref == ref } end + def matrix_builds(build = nil) + matrix_builds = builds.latest.ordered + matrix_builds = matrix_builds.similar(build) if build + matrix_builds.to_a + end + def retried @retried ||= (statuses.order(id: :desc) - statuses.latest) end -- cgit v1.2.1