diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-29 18:12:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-29 18:12:42 +0000 |
commit | fef5449973e2097fbedd92980d78dc4baf54afd6 (patch) | |
tree | fae2e4b1e9eb45e0e9b1da569721c5f8c1cea4ef /app/models/dependency_proxy | |
parent | cee701c9641a4dfa508f9a1d913863a52ae67167 (diff) | |
download | gitlab-ce-fef5449973e2097fbedd92980d78dc4baf54afd6.tar.gz |
Add latest changes from gitlab-org/gitlab@master
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 |