From f93e05de83e0d37d8ab6511c66e60b41c6a79c71 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 25 Apr 2012 07:59:32 -0400 Subject: [PATCH] use collection#save instead of collection#insert to save gridio chunks so that replacement chunks overwrite existing ones --- lib/mongo/gridfs/grid_io.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mongo/gridfs/grid_io.rb b/lib/mongo/gridfs/grid_io.rb index 323c1ba..a9e44de 100644 --- a/lib/mongo/gridfs/grid_io.rb +++ b/lib/mongo/gridfs/grid_io.rb @@ -275,7 +275,7 @@ module Mongo end def save_chunk(chunk) - @chunks.insert(chunk) + @chunks.save(chunk) end def get_chunk(n)