From d12987bf7abd41654d94ec3a0fa1f4d5c5036d5e Mon Sep 17 00:00:00 2001 From: Wojciech Piekutowski Date: Sun, 20 Feb 2011 17:09:18 +0100 Subject: [PATCH] Always initialize @metadata and @aliases --- lib/mongo/gridfs/grid_io.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mongo/gridfs/grid_io.rb b/lib/mongo/gridfs/grid_io.rb index f8d4750..4000364 100644 --- a/lib/mongo/gridfs/grid_io.rb +++ b/lib/mongo/gridfs/grid_io.rb @@ -335,8 +335,8 @@ module Mongo @files_id = opts.delete(:_id) || BSON::ObjectId.new @content_type = opts.delete(:content_type) || (defined? MIME) && get_content_type || DEFAULT_CONTENT_TYPE @chunk_size = opts.delete(:chunk_size) || DEFAULT_CHUNK_SIZE - @metadata = opts.delete(:metadata) if opts[:metadata] - @aliases = opts.delete(:aliases) if opts[:aliases] + @metadata = opts.delete(:metadata) + @aliases = opts.delete(:aliases) @file_length = 0 opts.each {|k, v| self[k] = v} check_existing_file if @safe