jnicklas/carrierwave — Issue #492: Can't get to uploaded file after model is saved
Author: Alamoz
Created: 2011-10-17 20:11:19+00:00
State: open

I'm uploading an image file, saving the associated model, then using an "after_save scale_file" filter am trying to manipulate the file with RMagic. The model saves properly, the file info is placed into the column reserved for it (in this case image_file), but when trying to access the uploaded file in the "scale_file" method, although the logger shows me I am retrieving the correct file name and path. I'm guessing there is a time lag where the tmp file is copied to the model's image save directory, but this is happening even when an image of the same name already exists in the final directory. The error I get is:

unable to open image `/uploads/scenario/image_file/16/DSC_6321.jpg': No such file or directory @ blob.c/OpenBlob/2480

I've tried scaling the image in the uploader itself, but have been unsuccessful trying to do that.

Thanks.