diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-18 00:09:20 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-18 00:09:20 +0000 |
commit | 72721699f11187199e89631ce0b5e3d2f7c167e9 (patch) | |
tree | b51a227be89d82aa24fc954e7b50e7b0933583cc /app/models/pages_domain.rb | |
parent | 06be418a7cd98a1c87c41ba43cca1ce9acbe885e (diff) | |
download | gitlab-ce-72721699f11187199e89631ce0b5e3d2f7c167e9.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/pages_domain.rb')
-rw-r--r-- | app/models/pages_domain.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/pages_domain.rb b/app/models/pages_domain.rb index 91767c53f81..05cf427184c 100644 --- a/app/models/pages_domain.rb +++ b/app/models/pages_domain.rb @@ -14,6 +14,7 @@ class PagesDomain < ApplicationRecord validates :domain, hostname: { allow_numeric_hostname: true } validates :domain, uniqueness: { case_sensitive: false } + validates :certificate, :key, presence: true, if: :usage_serverless? validates :certificate, presence: { message: 'must be present if HTTPS-only is enabled' }, if: :certificate_should_be_present? validates :certificate, certificate: true, if: ->(domain) { domain.certificate.present? } @@ -64,6 +65,8 @@ class PagesDomain < ApplicationRecord scope :with_logging_info, -> { includes(project: [:namespace, :route]) } + scope :instance_serverless, -> { where(wildcard: true, scope: :instance, usage: :serverless) } + def verified? !!verified_at end |