diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-02 09:08:59 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-02 09:08:59 +0300 |
commit | 5ab92edc77d032261ce105e3fa13355b92f8ed32 (patch) | |
tree | d2628c82859c7c8810481ec54c7d564f2e080b78 /app/services/design_management | |
parent | 0409a31740fa29fa1131c0496da16677cb3debe4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/design_management')
-rw-r--r-- | app/services/design_management/generate_image_versions_service.rb | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/app/services/design_management/generate_image_versions_service.rb b/app/services/design_management/generate_image_versions_service.rb index 3ff239b59cc..0771ada72a1 100644 --- a/app/services/design_management/generate_image_versions_service.rb +++ b/app/services/design_management/generate_image_versions_service.rb @@ -69,17 +69,15 @@ module DesignManagement # The LFS pointer file data contains an "OID" that lets us retrieve `LfsObject` # records, which have an Uploader (`LfsObjectUploader`) for the original design file. def raw_files_by_path - @raw_files_by_path ||= begin - LfsObject.for_oids(blobs_by_oid.keys).each_with_object({}) do |lfs_object, h| - blob = blobs_by_oid[lfs_object.oid] - file = lfs_object.file.file - # The `CarrierWave::SanitizedFile` is loaded without knowing the `content_type` - # of the file, due to the file not having an extension. - # - # Set the content_type from the `Blob`. - file.content_type = blob.content_type - h[blob.path] = file - end + @raw_files_by_path ||= LfsObject.for_oids(blobs_by_oid.keys).each_with_object({}) do |lfs_object, h| + blob = blobs_by_oid[lfs_object.oid] + file = lfs_object.file.file + # The `CarrierWave::SanitizedFile` is loaded without knowing the `content_type` + # of the file, due to the file not having an extension. + # + # Set the content_type from the `Blob`. + file.content_type = blob.content_type + h[blob.path] = file end end |