Skip to content
Snippets Groups Projects
Commit 263717d7 authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

Do not perform hard check (presence of file on storage)

Instead perform soft check (the column set to indicate that file does exist)
parent 7e69f188
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
---
title: File uploaders do not perform hard check, only soft check
merge_request:
author:
type: fixed
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment