lib/populate_me/mongo/stash.rb in populate-me-0.0.32 vs lib/populate_me/mongo/stash.rb in populate-me-0.0.33
- old
+ new
@@ -58,10 +58,11 @@
def delete_files_for(col)
obj = (@old_doc||@doc)[col]
if obj.respond_to?(:each)
obj.each do |k,v|
- model.gridfs.delete(v)
+ gridfile = model.gridfs.find(_id: v).first
+ model.gridfs.delete(v) unless gridfile.nil?
end
end
end
def after_delete