From 0f468754737b1640c03b2f0c3d5110f0f7a95ec3 Mon Sep 17 00:00:00 2001 From: Chris Winslett Date: Wed, 22 Feb 2012 08:44:19 -0600 Subject: [PATCH] Fixed issue when sending a :filename GridFS would store the :filename attribute twice. --- lib/mongo/gridfs/grid.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mongo/gridfs/grid.rb b/lib/mongo/gridfs/grid.rb index d8aa018..1df4b9e 100644 --- a/lib/mongo/gridfs/grid.rb +++ b/lib/mongo/gridfs/grid.rb @@ -68,7 +68,7 @@ module Mongo # @return [BSON::ObjectId] the file's id. def put(data, opts={}) opts = opts.dup - filename = opts[:filename] + filename = opts.delete(:filename) opts.merge!(default_grid_io_opts) file = GridIO.new(@files, @chunks, filename, 'w', opts) file.write(data)