From becb86ea4e8032788b151caac004b2635b57c6a4 Mon Sep 17 00:00:00 2001 From: Paul Slaughter Date: Wed, 3 Oct 2018 04:08:00 -0500 Subject: Add pipeline status to diffs/commit_item **Notes:** - Also exposes commit.pipeline_status_path in diffs.json --- app/models/commit.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/models/commit.rb') diff --git a/app/models/commit.rb b/app/models/commit.rb index 49c36ad9d3f..a61ed03cf35 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -319,7 +319,11 @@ class Commit def status(ref = nil) return @statuses[ref] if @statuses.key?(ref) - @statuses[ref] = project.pipelines.latest_status_per_commit(id, ref)[id] + @statuses[ref] = status_for_project(ref, project) + end + + def status_for_project(ref, pipeline_project) + pipeline_project.pipelines.latest_status_per_commit(id, ref)[id] end def set_status_for_ref(ref, status) -- cgit v1.2.1