jnicklas/carrierwave — pull request #571 by jeroenhouben (2011-12-22 11:30:08+00:00)
Title: Problem with recreate_version and Fog

in cache_stored_file! file.read sometimes returns returns a File object.

This seems to happen when you upload a new file, which is cached between form displays, then save the model, and then a recreate_version! is executed in an after_save.

I use this to create custom crops in my versions.

It seems like an ugly fix, but I don't really know how to solve it in a better way. Here's some debugging output that might give some clues.

```
(rdb:1) self

```

```
(rdb:1) attributes
{:body=>#, :content_type=>nil, :key=>"uploads/development/video/screenshot/1/image.jpg", :cache_control=>"max-age=315576000", "x-amz-id-2"=>"XXXXX", "x-amz-request-id"=>"XXXXXX", "Date"=>"Thu, 22 Dec 2011 11:10:49 GMT", :etag=>"6bad799a542968e7bfd883c6c550e784", :content_length=>170769, "Server"=>"AmazonS3"}
```

```
(rdb:1) body
#
```