Commit cd210689 by Pablo Cantero

Update README.md

parent d9859ec6
......@@ -71,9 +71,11 @@ query.to_query(params[:q])
You can use to_query! for stricter validations. This method will raise an exception if a query cannot be produced.
```ruby
query.to_query({ name: 'Pablo' })
# xpto isn't a valid predicate
query.to_query(name_xpto: 'Pablo')
# => {}
query.to_query!({ name: 'Pablo' })
query.to_query!(name_xpto: 'Pablo')
# => RansackMongo::MatcherNotFound: No matchers found. To allow empty queries use .to_query instead
```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment