Open vertis opened 8 years ago
I'm experiencing the same issue using GridFS. I've tracked the issue down to this line. It appears that nil
, the previous value, is always being overwritten by "_new_"
via ||
. When I remove this it works fine. Is there a reason why it has to use replace nil
with "_new_"
?
I am using a combination of carrierwave-mongoid (ORM support) and fog-google for the actual storage of the images.
When uploading a new image Carrierwave tries to delete the old image (that doesn't exist).
This happens because carrierwave-mongoid has:
Carrierwave ends up with the 'new' when calling
Specifically the
before
variable indef remove_previous(before=nil, after=nil)
(found inlib/carrierwave/mounter.rb
is not nil or blank.I'm not sure how to fix this properly, it looks like the 'new' is there for embedded document support, otherwise I would have just sent a pull request.