Do not perform hard check (presence of file on storage)
Instead perform soft check (the column set to indicate that file does exist)
This commit is contained in:
parent
7e69f1889b
commit
263717d70c
4 changed files with 8 additions and 3 deletions
|
@ -28,7 +28,7 @@ class Projects::UploadsController < Projects::ApplicationController
|
|||
end
|
||||
|
||||
def image_or_video?
|
||||
uploader && uploader.file.exists? && uploader.image_or_video?
|
||||
uploader && uploader.exists? && uploader.image_or_video?
|
||||
end
|
||||
|
||||
def uploader_class
|
||||
|
|
|
@ -9,7 +9,7 @@ class AvatarUploader < GitlabUploader
|
|||
end
|
||||
|
||||
def exists?
|
||||
model.avatar.file && model.avatar.file.exists?
|
||||
model.avatar.file && model.avatar.file.present?
|
||||
end
|
||||
|
||||
# We set move_to_store and move_to_cache to 'false' to prevent stealing
|
||||
|
|
|
@ -51,7 +51,7 @@ class GitlabUploader < CarrierWave::Uploader::Base
|
|||
end
|
||||
|
||||
def exists?
|
||||
file.try(:exists?)
|
||||
file.present?
|
||||
end
|
||||
|
||||
# Override this if you don't want to save files by default to the Rails.root directory
|
||||
|
|
5
changelogs/unreleased/do-not-perform-disk-check.yml
Normal file
5
changelogs/unreleased/do-not-perform-disk-check.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: File uploaders do not perform hard check, only soft check
|
||||
merge_request:
|
||||
author:
|
||||
type: fixed
|
Loading…
Reference in a new issue