diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 14:59:07 +0300 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /app/models/packages/package_file.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/models/packages/package_file.rb')
-rw-r--r-- | app/models/packages/package_file.rb | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/app/models/packages/package_file.rb b/app/models/packages/package_file.rb index d68f75140ac..e8d1dd1e8c4 100644 --- a/app/models/packages/package_file.rb +++ b/app/models/packages/package_file.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true class Packages::PackageFile < ApplicationRecord include UpdateProjectStatistics + include FileStoreMounter delegate :project, :project_id, to: :package delegate :conan_file_type, to: :conan_file_metadatum @@ -35,20 +36,12 @@ class Packages::PackageFile < ApplicationRecord .where(packages_conan_file_metadata: { conan_package_reference: conan_package_reference }) end - mount_uploader :file, Packages::PackageFileUploader - - after_save :update_file_metadata, if: :saved_change_to_file? + mount_file_store_uploader Packages::PackageFileUploader update_project_statistics project_statistics_name: :packages_size before_save :update_size_from_file - def update_file_metadata - # The file.object_store is set during `uploader.store!` - # which happens after object is inserted/updated - self.update_column(:file_store, file.object_store) - end - def download_path Gitlab::Routing.url_helpers.download_project_package_file_path(project, self) end |