Skip to content

Commit

Permalink
Fix CarrierWave store! method
Browse files Browse the repository at this point in the history
This broke for us upgrading to cloudinary v2 i assume this was a legacy setting
  • Loading branch information
ollym authored Apr 9, 2024
1 parent 5853b97 commit 0101cfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cloudinary/carrier_wave/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def store!(file)
params[:type]=uploader.class.storage_type

params[:resource_type] ||= :auto
upload_method = uploader.upload_chunked? ? "upload_large" : "upload"
upload_method = uploader.respond_to?(:upload_chunked?) && uploader.upload_chunked? ? "upload_large" : "upload"
uploader.metadata = Cloudinary::Uploader.send(upload_method, data, params)
if uploader.metadata["error"]
raise Cloudinary::CarrierWave::UploadError.new(uploader.metadata["error"]["message"], uploader.metadata["error"]["http_code"])
Expand Down

0 comments on commit 0101cfd

Please sign in to comment.