diff options
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 6bb018b086f..562c3ed15b2 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -207,12 +207,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 |