diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-12 21:07:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-12 21:07:29 +0300 |
commit | 753eb533e509464184ad267fb894d2c08d0d1ba6 (patch) | |
tree | 4595d9e4acfa3660e9b682055fa30f7289e59d37 /app/models/pages_deployment.rb | |
parent | 1ba682300fb97a96de47cc5b261f6df93ca78bd0 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/pages_deployment.rb')
-rw-r--r-- | app/models/pages_deployment.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/pages_deployment.rb b/app/models/pages_deployment.rb index ec2293fa032..93b041f0426 100644 --- a/app/models/pages_deployment.rb +++ b/app/models/pages_deployment.rb @@ -11,9 +11,11 @@ class PagesDeployment < ApplicationRecord attribute :file_store, :integer, default: -> { ::Pages::DeploymentUploader.default_store } belongs_to :project, optional: false + + # ci_build is optional, because PagesDeployment must live even if its build/pipeline is removed. belongs_to :ci_build, class_name: 'Ci::Build', optional: true - scope :older_than, -> (id) { where('id < ?', id) } + scope :older_than, ->(id) { where('id < ?', id) } scope :migrated_from_legacy_storage, -> { where(file: MIGRATED_FILE_NAME) } scope :with_files_stored_locally, -> { where(file_store: ::ObjectStorage::Store::LOCAL) } scope :with_files_stored_remotely, -> { where(file_store: ::ObjectStorage::Store::REMOTE) } |