summaryrefslogtreecommitdiff
path: root/app/models/project.rb
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-09-28 13:35:26 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2015-09-29 10:47:03 +0200
commit0e3381470870732dff69c9298131062f786d55e7 (patch)
tree02a4a5e588c73c066fa80222b03065d3b8295e24 /app/models/project.rb
parent30c78e70cba395c1336611c58891a75473f8a037 (diff)
downloadgitlab-ce-0e3381470870732dff69c9298131062f786d55e7.tar.gz
Fix tests
Diffstat (limited to 'app/models/project.rb')
-rw-r--r--app/models/project.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 9ecf16d9812..ddf8526d6c2 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -748,6 +748,12 @@ class Project < ActiveRecord::Base
gitlab_ci_project.commits.find_by(sha: sha) if gitlab_ci?
end
+ def ensure_ci_project
+ unless gitlab_ci_project
+ create_gitlab_ci_project
+ end
+ end
+
def enable_ci(user)
# Enable service
service = gitlab_ci_service || create_gitlab_ci_service