gitlab-org--gitlab-foss/app/models/clusters/project.rb

14 lines
496 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2017-10-23 04:36:35 -04:00
module Clusters
class Project < ActiveRecord::Base
self.table_name = 'cluster_projects'
2017-10-29 14:48:45 -04:00
belongs_to :cluster, class_name: 'Clusters::Cluster'
belongs_to :project, class_name: '::Project'
has_many :kubernetes_namespaces, class_name: 'Clusters::KubernetesNamespace', foreign_key: :cluster_project_id
has_one :kubernetes_namespace, -> { order(id: :desc) }, class_name: 'Clusters::KubernetesNamespace', foreign_key: :cluster_project_id
2017-10-23 04:36:35 -04:00
end
end