Commit 2d242119 authored by Alishan Ladhani's avatar Alishan Ladhani

Define association between PagesDomain and Serverless::DomainCluster

parent feef9ebc
...@@ -11,6 +11,7 @@ class PagesDomain < ApplicationRecord ...@@ -11,6 +11,7 @@ class PagesDomain < ApplicationRecord
belongs_to :project belongs_to :project
has_many :acme_orders, class_name: "PagesDomainAcmeOrder" has_many :acme_orders, class_name: "PagesDomainAcmeOrder"
has_many :serverless_domain_clusters, class_name: 'Serverless::DomainCluster', inverse_of: :pages_domain
validates :domain, hostname: { allow_numeric_hostname: true } validates :domain, hostname: { allow_numeric_hostname: true }
validates :domain, uniqueness: { case_sensitive: false } validates :domain, uniqueness: { case_sensitive: false }
......
...@@ -9,6 +9,7 @@ describe PagesDomain do ...@@ -9,6 +9,7 @@ describe PagesDomain do
describe 'associations' do describe 'associations' do
it { is_expected.to belong_to(:project) } it { is_expected.to belong_to(:project) }
it { is_expected.to have_many(:serverless_domain_clusters) }
end end
describe 'validate domain' do describe 'validate domain' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment