From aa86c03bd514c0deafedc0f7a060e0d66683d369 Mon Sep 17 00:00:00 2001 From: Mike Dirolf Date: Tue, 23 Mar 2010 17:00:31 -0400 Subject: [PATCH] test and fix for Grid#delete --- lib/mongo/gridfs/grid.rb | 2 +- test/grid_test.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mongo/gridfs/grid.rb b/lib/mongo/gridfs/grid.rb index 523bd8c..0a9984c 100644 --- a/lib/mongo/gridfs/grid.rb +++ b/lib/mongo/gridfs/grid.rb @@ -78,7 +78,7 @@ module Mongo # @return [Boolean] def delete(id) @files.remove({"_id" => id}) - @chunks.remove({"_id" => id}) + @chunks.remove({"files_id" => id}) end private diff --git a/test/grid_test.rb b/test/grid_test.rb index 4dce634..9486f79 100644 --- a/test/grid_test.rb +++ b/test/grid_test.rb @@ -42,6 +42,7 @@ class GridTest < Test::Unit::TestCase assert_raise GridError do @grid.get(@id) end + assert_equal nil, @db['test-fs']['chunks'].find_one({:files_id => @id}) end end