summaryrefslogtreecommitdiff
path: root/app/models/commit.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-10-06 12:01:16 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-10-12 11:53:49 +0200
commit914cfbd2f154ed3154a7dc3cee3309713eea786f (patch)
tree445862a347f3c915b2c41f0e8ba26d362017aa52 /app/models/commit.rb
parent5ffbf5feb7577ec3affc32992c79cddca3036c4d (diff)
downloadgitlab-ce-914cfbd2f154ed3154a7dc3cee3309713eea786f.tar.gz
Implement Commit Status API
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r--app/models/commit.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index aff329d71fa..d5c50013525 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -184,4 +184,12 @@ class Commit
def parents
@parents ||= Commit.decorate(super, project)
end
+
+ def ci_commit
+ project.ci_commit(sha)
+ end
+
+ def status
+ ci_commit.try(:status) || :not_found
+ end
end