-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Old image kept on cloudinary #311
Comments
Hi @Nkadze Could you maybe share a code snippet so we could verify we are on the same page? Also if you could share the versions that are being used of your Ruby, Rails, Cloudinary GEM and CarrierWave installations we could take a closer look. |
@idobarnoam, Thanks for quick response, Those are package versions:
Uploader: class ImageUploader < CarrierWave::Uploader::Base
include Cloudinary::CarrierWave
process resize_to_fit: [1920, 1080]
version :small do
cloudinary_transformation \
gravity: 'auto',
width: 150,
height: 100,
crop: 'fill',
quality: 'auto',
fetch_format: :auto
end
end Model: mount_uploader :featured_image, ImageUploader Update Code: obj.update_attributes(remote_featured_image_url: url) or: @model.update(model_params)
#--------------
def model_params
params.require(:model).permit(:name, :featured_image, :featured_image_cache)
end |
Thank you @Nkadze. We're taking a look and we'll let you know of any insights. |
I have the same problem, updating an attachment through a fileupload creates a new file on cloudinary leaving the old one untouched. If I look at the carrier_wave.rb file, there is only a Cloudinary::Uploader.destroy call in the delete method, but no after_update functionality to destroy the old public_id. |
I fixed it by adding a callback to my uploaders. Since carrierwave stores the public_id within an identifier with resource_type ... and the destructuring method is not modular, I choose to initialize a new CloudinaryFile object and call the delete method.
|
Hi,
When I'm updating image from rails form, through
update_attributes
and carrierwave uploader, on cloudinary both: new and old images are kept. Is it possible to override this behavior?Thanks in advance.
The text was updated successfully, but these errors were encountered: