Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-08-02 15:01:22 +0300
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-08-11 22:29:57 +0300
commit49f72e705fa225175834b5e6b2b1f78f1f608b9c (patch)
treeeeb8ab64c3aa954989b420b58b3f646e83782085 /app/models/deployment.rb
parentcbafc9ef301dbdc3c3205541cd0f8e31e28ece7a (diff)
Show deployment status on a MR view
Diffstat (limited to 'app/models/deployment.rb')
-rw-r--r--app/models/deployment.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/deployment.rb b/app/models/deployment.rb
index 1a7cd60817e..67a4f3998ec 100644
--- a/app/models/deployment.rb
+++ b/app/models/deployment.rb
@@ -36,4 +36,11 @@ class Deployment < ActiveRecord::Base
def manual_actions
deployable.try(:other_actions)
end
+
+ def deployed_to(ref)
+ commit = project.commit(ref)
+ return false unless commit
+
+ project.repository.merge_base(commit.id, sha) == commit.id
+ end
end