Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

change README use doc instead of row #132

Merged
merged 1 commit into from

2 participants

Timo Schilling Tyler Brock
Timo Schilling

because it is a document and not a row based db ;)

Timo Schilling timoschilling change README use doc instead of row
because it is a document and not a row based db ;)
2820504
Tyler Brock TylerBrock merged commit e3c6654 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 14, 2012
  1. Timo Schilling

    change README use doc instead of row

    timoschilling authored
    because it is a document and not a row based db ;)
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 8 deletions.
  1. +8 −8 README.md
16 README.md
View
@@ -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
```
Something went wrong with that request. Please try again.