diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/models/pages_deployment.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/models/pages_deployment.rb')
-rw-r--r-- | app/models/pages_deployment.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/models/pages_deployment.rb b/app/models/pages_deployment.rb index cd952c32046..61818a63764 100644 --- a/app/models/pages_deployment.rb +++ b/app/models/pages_deployment.rb @@ -4,19 +4,27 @@ class PagesDeployment < ApplicationRecord include FileStoreMounter + attribute :file_store, :integer, default: -> { ::Pages::DeploymentUploader.default_store } + belongs_to :project, optional: false belongs_to :ci_build, class_name: 'Ci::Build', optional: true + scope :older_than, -> (id) { where('id < ?', id) } + validates :file, presence: true validates :file_store, presence: true, inclusion: { in: ObjectStorage::SUPPORTED_STORES } validates :size, presence: true, numericality: { greater_than: 0, only_integer: true } + validates :file_count, presence: true, numericality: { greater_than_or_equal_to: 0, only_integer: true } + validates :file_sha256, presence: true before_validation :set_size, if: :file_changed? - default_value_for(:file_store) { ::Pages::DeploymentUploader.default_store } - mount_file_store_uploader ::Pages::DeploymentUploader + def log_geo_deleted_event + # this is to be adressed in https://gitlab.com/groups/gitlab-org/-/epics/589 + end + private def set_size |