summaryrefslogtreecommitdiff
path: root/app/models/dependency_proxy/blob.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/dependency_proxy/blob.rb')
-rw-r--r--app/models/dependency_proxy/blob.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/dependency_proxy/blob.rb b/app/models/dependency_proxy/blob.rb
index f7b08f1d077..dc40ff62adb 100644
--- a/app/models/dependency_proxy/blob.rb
+++ b/app/models/dependency_proxy/blob.rb
@@ -5,8 +5,10 @@ class DependencyProxy::Blob < ApplicationRecord
include TtlExpirable
include Packages::Destructible
include EachBatch
+ include UpdateNamespaceStatistics
belongs_to :group
+ alias_attribute :namespace, :group
MAX_FILE_SIZE = 5.gigabytes.freeze
@@ -17,6 +19,7 @@ class DependencyProxy::Blob < ApplicationRecord
scope :with_files_stored_locally, -> { where(file_store: ::DependencyProxy::FileUploader::Store::LOCAL) }
mount_file_store_uploader DependencyProxy::FileUploader
+ update_namespace_statistics namespace_statistics_name: :dependency_proxy_size
def self.total_size
sum(:size)