Permalink
Browse files

[DOC] Update documentation for Mongoid users in Readme

* Leave out needless code
* Use `as_json`, not `to_json` in the `Article.to_indexed_json`!
* Use the proxy to not mix it up with Mongoid interface: `Article.tire.search 'love'`

Fixes #157.
  • Loading branch information...
1 parent ac42137 commit aa1963807abe62f6fa5f363f8682afb51b67ee04 @karmi karmi committed Mar 16, 2012
Showing with 2 additions and 6 deletions.
  1. +2 −6 README.markdown
View
@@ -688,21 +688,17 @@ Well, things stay mostly the same:
include Tire::Model::Search
include Tire::Model::Callbacks
- # Let's use a different index name so stuff doesn't get mixed up.
- #
- index_name 'mongo-articles'
-
# These Mongo guys sure do get funky with their IDs in +serializable_hash+, let's fix it.
#
def to_indexed_json
- self.to_json
+ self.as_json
end
end
Article.create :title => 'I Love ElasticSearch'
- Article.search 'love'
+ Article.tire.search 'love'
```
_Tire_ does not care what's your primary data storage solution, if it has an _ActiveModel_-compatible

0 comments on commit aa19638

Please sign in to comment.