summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb7
1 files changed, 4 insertions, 3 deletions
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