diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 11:43:02 +0300 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /app/models/dependency_proxy | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'app/models/dependency_proxy')
-rw-r--r-- | app/models/dependency_proxy/blob.rb | 5 | ||||
-rw-r--r-- | app/models/dependency_proxy/image_ttl_group_policy.rb | 2 | ||||
-rw-r--r-- | app/models/dependency_proxy/manifest.rb | 5 |
3 files changed, 6 insertions, 6 deletions
diff --git a/app/models/dependency_proxy/blob.rb b/app/models/dependency_proxy/blob.rb index 5de6b1cf28f..7ca15652586 100644 --- a/app/models/dependency_proxy/blob.rb +++ b/app/models/dependency_proxy/blob.rb @@ -2,15 +2,14 @@ class DependencyProxy::Blob < ApplicationRecord include FileStoreMounter + include TtlExpirable + include EachBatch belongs_to :group validates :group, presence: true validates :file, presence: true validates :file_name, presence: true - validates :status, presence: true - - enum status: { default: 0, expired: 1 } mount_file_store_uploader DependencyProxy::FileUploader diff --git a/app/models/dependency_proxy/image_ttl_group_policy.rb b/app/models/dependency_proxy/image_ttl_group_policy.rb index 5a1b8cb8f1f..0dfb298a39e 100644 --- a/app/models/dependency_proxy/image_ttl_group_policy.rb +++ b/app/models/dependency_proxy/image_ttl_group_policy.rb @@ -8,4 +8,6 @@ class DependencyProxy::ImageTtlGroupPolicy < ApplicationRecord validates :group, presence: true validates :enabled, inclusion: { in: [true, false] } validates :ttl, numericality: { greater_than: 0 }, allow_nil: true + + scope :enabled, -> { where(enabled: true) } end diff --git a/app/models/dependency_proxy/manifest.rb b/app/models/dependency_proxy/manifest.rb index 15e5137b50a..b83047efe54 100644 --- a/app/models/dependency_proxy/manifest.rb +++ b/app/models/dependency_proxy/manifest.rb @@ -2,6 +2,8 @@ class DependencyProxy::Manifest < ApplicationRecord include FileStoreMounter + include TtlExpirable + include EachBatch belongs_to :group @@ -9,9 +11,6 @@ class DependencyProxy::Manifest < ApplicationRecord validates :file, presence: true validates :file_name, presence: true validates :digest, presence: true - validates :status, presence: true - - enum status: { default: 0, expired: 1 } mount_file_store_uploader DependencyProxy::FileUploader |