Commit 71f4ae4a authored by Micaël Bergeron's avatar Micaël Bergeron

fixing the move_to_* pattern

parent 787e4345
......@@ -8,6 +8,14 @@ class AvatarUploader < GitlabUploader
model.avatar.file && model.avatar.file.present?
end
def move_to_store
false
end
def move_to_cache
false
end
private
def dynamic_segment
......
......@@ -33,14 +33,12 @@ class GitlabUploader < CarrierWave::Uploader::Base
cache_storage.is_a?(CarrierWave::Storage::File)
end
# Reduce disk IO
def move_to_cache
super.nil? ? true : super
file_storage?
end
# Reduce disk IO
def move_to_store
super.nil? ? true : super
file_storage?
end
def exists?
......
......@@ -202,14 +202,6 @@ module ObjectStorage
false
end
def move_to_store
false
end
def move_to_cache
false
end
def delete_migrated_file(migrated_file)
migrated_file.delete if exists?
end
......
......@@ -19,7 +19,7 @@ FactoryBot.define do
end
trait :with_avatar do
avatar { File.open(Rails.root.join('spec/fixtures/dk.png')) }
avatar { fixture_file_upload('spec/fixtures/dk.png') }
end
factory :group_with_members do
......
......@@ -122,7 +122,7 @@ FactoryBot.define do
end
trait :with_avatar do
avatar { File.open(Rails.root.join('spec/fixtures/dk.png')) }
avatar { fixture_file_upload('spec/fixtures/dk.png') }
end
trait :broken_storage do
......
......@@ -42,7 +42,7 @@ FactoryBot.define do
end
trait :with_avatar do
avatar { File.open(Rails.root.join('spec/fixtures/dk.png')) }
avatar { fixture_file_upload('spec/fixtures/dk.png') }
end
trait :two_factor_via_otp do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment