From 2fc1e657a8fd659de4c27099142d7e201391c010 Mon Sep 17 00:00:00 2001 From: Andrei Zinca Date: Sat, 9 Apr 2011 13:46:11 +0300 Subject: [PATCH] update readme --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 95fee93..5d2e047 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ +This fork is compatible with 2.0.1 and adds the possibility to chain the search +function into other criteria. + +Assuming you have a category with multiple products you can now use the following +code to search for 'iphone' in products cheaper than $499 + + @category.products.where(:price.lt => 499).asc(:price).csearch('iphone') + +In this case we have to use csearch, an alias for search, because since v2.0.0 +Mongoid defines it's own Criteria.search method. + Mongoid Search ============