From 5d69f5b46d475f34fb71dfb4e8b683e90897f1da Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Thu, 31 Mar 2016 19:51:28 +0200 Subject: Use Ci::Commit as Pipeline --- app/models/commit.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'app/models/commit.rb') diff --git a/app/models/commit.rb b/app/models/commit.rb index d09876a07d9..a898f7ba337 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -209,12 +209,13 @@ class Commit @raw.short_id(7) end - def ci_commit - project.ci_commit(sha) + def ci_commits + @ci_commits ||= project.ci_commits.where(sha: sha) end def status - ci_commit.try(:status) || :not_found + return @status if defined?(@status) + @status ||= ci_commits.status end def revert_branch_name -- cgit v1.2.1