From 59f32caf573b646e24950ade76f6b2f9b52366d0 Mon Sep 17 00:00:00 2001 From: Jim Menard Date: Thu, 15 Jan 2009 15:12:16 -0500 Subject: [PATCH] Fixed DBRef BSON format. --- Rakefile | 2 +- lib/mongo/util/bson.rb | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Rakefile b/Rakefile index 16b659a..3803487 100644 --- a/Rakefile +++ b/Rakefile @@ -7,7 +7,7 @@ require 'rake/gempackagetask' require 'rake/contrib/rubyforgepublisher' GEM = "mongo" -GEM_VERSION = '0.1.1' +GEM_VERSION = '0.1.2' SUMMARY = 'Simple pure-Ruby driver for the 10gen Mongo DB' DESCRIPTION = 'This is a simple pure-Ruby driver for the 10gen Mongo DB. For more information about Mongo, see http://www.mongodb.org.' AUTHOR = 'Jim Menard' diff --git a/lib/mongo/util/bson.rb b/lib/mongo/util/bson.rb index 69cfd73..76033a8 100644 --- a/lib/mongo/util/bson.rb +++ b/lib/mongo/util/bson.rb @@ -252,7 +252,7 @@ class BSON end def deserialize_dbref_data(buf, key, parent) - ns = deserialize_cstr(buf) + ns = deserialize_string_data(buf) oid = deserialize_oid_data(buf) XGen::Mongo::Driver::DBRef.new(parent, key, @db, ns, oid) end @@ -275,9 +275,7 @@ class BSON end def serialize_dbref_element(buf, key, val) - buf.put(REF) - self.class.serialize_cstr(buf, key) - self.class.serialize_cstr(buf, val.namespace) + serialize_string_element(buf, key, val.namespace, REF) buf.put_array(val.object_id.to_a) end