Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-08 21:11:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-08 21:11:09 +0300
commitda576e4a0b8e1adc3df559a163b01c962a565ef5 (patch)
treef563a8746fd54a2d638f6b421955220af24c8489 /app/models/serverless
parentb5bdf6e5219b3b57107aee49ba7c103affb65dd9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/serverless')
-rw-r--r--app/models/serverless/domain_cluster.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/serverless/domain_cluster.rb b/app/models/serverless/domain_cluster.rb
index 1effabf1c22..561bfc65b2b 100644
--- a/app/models/serverless/domain_cluster.rb
+++ b/app/models/serverless/domain_cluster.rb
@@ -19,7 +19,7 @@ module Serverless
validates :uuid, presence: true, uniqueness: true, length: { is: ::Serverless::Domain::UUID_LENGTH },
format: { with: HEX_REGEXP, message: 'only allows hex characters' }
- default_value_for(:uuid, allows_nil: false) { ::Serverless::Domain.generate_uuid }
+ after_initialize :set_uuid, if: :new_record?
delegate :domain, to: :pages_domain
delegate :cluster, to: :knative
@@ -29,5 +29,11 @@ module Serverless
.includes(:pages_domain, :knative)
.find_by(uuid: uuid)
end
+
+ private
+
+ def set_uuid
+ self.uuid = ::Serverless::Domain.generate_uuid
+ end
end
end