You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def #{column}_will_change!
changed_attributes["#{column}"] = '_new_'
end
Carrierwave ends up with the 'new' when calling
# lib/carrierwave/mount.rb
def remove_previously_stored_#{column}
_mounter(:#{column}).remove_previous(*@_previous_changes_for_#{column})
end
Specifically the before variable in def remove_previous(before=nil, after=nil) (found in lib/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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: