summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2016-03-31 19:51:28 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2016-04-11 23:32:54 +0200
commit5d69f5b46d475f34fb71dfb4e8b683e90897f1da (patch)
tree48f268cb483ecab1d8d7e042c60931596838b1a3 /app/models/commit.rb
parent986b4a54ee159de56a7ebe51327887b49474813b (diff)
downloadgitlab-ce-5d69f5b46d475f34fb71dfb4e8b683e90897f1da.tar.gz
Use Ci::Commit as Pipeline
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