You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tl;dr: When a file initially exists and that is updated, any versions with overridden full_filename will not make it out of the temp directory
My code looks like this:
class LogoUploader < CarrierWave::Uploader::Base
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
version :thumb
version :small
version :medium
version :png do
def full_filename(for_file = model.logo.file)
"png_logo.png"
end
end
end
Blank slate
> s.update!(logo: nil)
> s.logo.url
=> nil
aws s3 ls s3://our-great-bucket/uploads/store/logo/2076/
<nothing here>
tl;dr: When a file initially exists and that is updated, any versions with overridden
full_filename
will not make it out of the temp directoryMy code looks like this:
Blank slate
Uploading a file initially
Great success - the original image plus 4 versions are all in the temp directory.
Everything is as it should be - the original image plus 4 versions are all in the permanent directory
Updating the file
Starting from the step above, where the logo is populated:
Everything is as it should be - the original image plus 4 versions are all in the temp directory
Missing
png_fulfillment_details.png
.Dependencies
aws-sdk-s3 (1.136.0)
carrierwave (3.0.4)
carrierwave-aws (1.6.0)
rails (6.0.6.1)
ruby "2.7.8"
The text was updated successfully, but these errors were encountered: