Closed clickworkorange closed 2 weeks ago
Most likely cause for this is assignment order. Suppose your controller receives the params like this:
{image: {image_file: #<File ...>, role: "thumb", ...}}
CarrierWave processing happens on the assignment of image_file
, without waiting for the assignment of role
.
Please make sure that role
is set to correct value, before assigning the file.
I have a model
Image
which has arole:string
attribute and mounts:image_file
uploader. I want to check therole
attribute in myImageFileUploader
class, and produce a different set of versions depending on its value:If I upload an image and set the role to "banner" only the
:thumb
gets created. For any other role the:normal
version is produced and the:banner
version is skipped - just as expected. Why doesn't the:is_banner?
condition work here?