From cd552fbf12d8778f741dd60ffef9a3642109efa5 Mon Sep 17 00:00:00 2001 From: Mike Manewitz Date: Mon, 3 Oct 2011 18:02:30 -0500 Subject: [PATCH] tweaked Markdown to display code snippet properly --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4309159..c53a6b3 100644 --- a/README.md +++ b/README.md @@ -208,14 +208,14 @@ keys. This is the PKFactory that comes with the MongoRecord code (an ActiveRecord-like framework for non-Rails apps) and the AR Mongo adapter code (for Rails): - class PKFactory - def create_pk(row) - return row if row[:_id] - row.delete(:_id) # in case it exists but the value is nil - row['_id'] ||= Mongo::ObjectID.new - row + class PKFactory + def create_pk(row) + return row if row[:_id] + row.delete(:_id) # in case it exists but the value is nil + row['_id'] ||= Mongo::ObjectID.new + row + end end - end A database's PK factory object may be set either when a DB object is created or immediately after you obtain it, but only once. The only reason it is