CarrierWave: When your uploader generates filenames dynamically, use model.save! instead of uploader.recreate_versions!

Updated . Posted . Visible to the public.

If your Carrierwave uploader dynamically generates the filename (e.g. by incorporating a user's name), you must call model.save! after recreating versions.

uploader.recreate_versions! does not update the model with the stored filename.

Dominik Schöler
Last edit
Henning Koch
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2016-12-16 12:03)