diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 12:45:46 +0300 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /app/models/dependency_proxy | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'app/models/dependency_proxy')
-rw-r--r-- | app/models/dependency_proxy/blob.rb | 4 | ||||
-rw-r--r-- | app/models/dependency_proxy/manifest.rb | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/app/models/dependency_proxy/blob.rb b/app/models/dependency_proxy/blob.rb index e4018ab4770..f7b08f1d077 100644 --- a/app/models/dependency_proxy/blob.rb +++ b/app/models/dependency_proxy/blob.rb @@ -14,6 +14,8 @@ class DependencyProxy::Blob < ApplicationRecord validates :file, presence: true validates :file_name, presence: true + scope :with_files_stored_locally, -> { where(file_store: ::DependencyProxy::FileUploader::Store::LOCAL) } + mount_file_store_uploader DependencyProxy::FileUploader def self.total_size @@ -24,3 +26,5 @@ class DependencyProxy::Blob < ApplicationRecord find_or_initialize_by(file_name: file_name) end end + +DependencyProxy::Blob.prepend_mod_with('DependencyProxy::Blob') diff --git a/app/models/dependency_proxy/manifest.rb b/app/models/dependency_proxy/manifest.rb index fe887c99e81..c2587ffac9d 100644 --- a/app/models/dependency_proxy/manifest.rb +++ b/app/models/dependency_proxy/manifest.rb @@ -17,6 +17,7 @@ class DependencyProxy::Manifest < ApplicationRecord validates :digest, presence: true scope :order_id_desc, -> { reorder(id: :desc) } + scope :with_files_stored_locally, -> { where(file_store: ::DependencyProxy::FileUploader::Store::LOCAL) } mount_file_store_uploader DependencyProxy::FileUploader @@ -24,3 +25,5 @@ class DependencyProxy::Manifest < ApplicationRecord find_by(file_name: file_name) || find_by(digest: digest) end end + +DependencyProxy::Manifest.prepend_mod_with('DependencyProxy::Manifest') |