diff options
author | Nick Thomas <nick@gitlab.com> | 2016-12-08 16:36:26 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2016-12-14 21:06:26 +0000 |
commit | b7b83fe0c9368fa6f04dcb6eb8cd247978bba76b (patch) | |
tree | 9e2a6a71c20b8c379cfc7031903df93456c3cb10 /app/models/project.rb | |
parent | 3e90aa1119fc4c77e92e6492f1906f252d90b64e (diff) | |
download | gitlab-ce-b7b83fe0c9368fa6f04dcb6eb8cd247978bba76b.tar.gz |
Introduce deployment services, starting with a KubernetesService
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 77d740081c6..2c726cfc5df 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -106,6 +106,7 @@ class Project < ActiveRecord::Base has_one :bugzilla_service, dependent: :destroy has_one :gitlab_issue_tracker_service, dependent: :destroy, inverse_of: :project has_one :external_wiki_service, dependent: :destroy + has_one :kubernetes_service, dependent: :destroy, inverse_of: :project has_one :forked_project_link, dependent: :destroy, foreign_key: "forked_to_project_id" has_one :forked_from_project, through: :forked_project_link @@ -742,6 +743,14 @@ class Project < ActiveRecord::Base @ci_service ||= ci_services.reorder(nil).find_by(active: true) end + def deployment_services + services.where(category: :deployment) + end + + def deployment_service + @deployment_service ||= deployment_services.reorder(nil).find_by(active: true) + end + def jira_tracker? issues_tracker.to_param == 'jira' end |