I have default settings from gem readme. My uploader looks like
module Uploaders
module TaxBaseCalculation
class Xlsx < CarrierWave::Uploader::Base
storage :aws
def store_dir
"tax_base_calculation/xlsx/user_#{model.order.user_id}/order_#{model.order_id}/calculation_#{model.id}"
end
def extension_whitelist
%w[xlsx]
end
def cache_dir
Rails.root.join 'tmp/uploads'
end
end
end
end
this is how I try to cache file
file.cache_stored_file!
file.retrieve_from_cache!(file.cache_name)
# operation is successful, but there is no file in cache folder:
puts "path: #{file.path}, exists?: #{File.exist?(file.path)}"
# => false
# cache_name and path attributes are correct
file.cache_name
# => "1614070761-355256537201132-0002-4079/73753502-55_Расчет_налоговой_базы.xlsx"
file.path
# => "tmp/uploads/1614070761-355256537201132-0002-4079/73753502-55_Расчет_налоговой_базы.xlsx"
I have default settings from gem readme. My uploader looks like
this is how I try to cache file