Fixed issue when sending a :filename GridFS would store the :filename attribute twice.

This commit is contained in:
Chris Winslett 2012-02-22 08:44:19 -06:00
parent c802c7eba3
commit 0f46875473
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ module Mongo
# @return [BSON::ObjectId] the file's id. # @return [BSON::ObjectId] the file's id.
def put(data, opts={}) def put(data, opts={})
opts = opts.dup opts = opts.dup
filename = opts[:filename] filename = opts.delete(:filename)
opts.merge!(default_grid_io_opts) opts.merge!(default_grid_io_opts)
file = GridIO.new(@files, @chunks, filename, 'w', opts) file = GridIO.new(@files, @chunks, filename, 'w', opts)
file.write(data) file.write(data)