debian-mirror-gitlab/app/models/clusters/project.rb

14 lines
495 B
Ruby
Raw Normal View History

2018-11-18 11:00:15 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
module Clusters
2019-05-18 00:54:41 +05:30
class Project < ApplicationRecord
2018-03-17 18:26:18 +05:30
self.table_name = 'cluster_projects'
belongs_to :cluster, class_name: 'Clusters::Cluster'
belongs_to :project, class_name: '::Project'
2018-12-13 13:39:08 +05:30
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
2018-03-17 18:26:18 +05:30
end
end