Permalink
Browse files

Merge pull request #132 from timoschilling/patch-1

change README use doc instead of row
  • Loading branch information...
2 parents 138a3ef + 2820504 commit e3c66543c708cdfa140ee8f17a46e86b0116d3f2 @TylerBrock TylerBrock committed Nov 14, 2012
Showing with 8 additions and 8 deletions.
  1. +8 −8 README.md
View
16 README.md
@@ -239,9 +239,9 @@ returned will be inserted.
Here is a sample primary key factory, taken from the tests:
```ruby
class TestPKFactory
- def create_pk(row)
- row['_id'] ||= BSON::ObjectId.new
- row
+ def create_pk(doc)
+ doc['_id'] ||= BSON::ObjectId.new
+ doc
end
end
```
@@ -251,11 +251,11 @@ ActiveRecord-like framework for non-Rails apps) and the AR Mongo adapter code
(for Rails):
```ruby
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'] ||= BSON::ObjectId.new
- row
+ def create_pk(doc)
+ return doc if doc[:_id]
+ doc.delete(:_id) # in case it exists but the value is nil
+ doc['_id'] ||= BSON::ObjectId.new
+ doc
end
end
```

0 comments on commit e3c6654

Please sign in to comment.