neo4jrb/neo4j — pull request #584 by subvertallchris (2014-11-17 22:39:46+00:00)
Title: Better match to

This exposes a bit more of QueryProxy's innards so match_to can be more flexible. I find myself constantly doing things like this:

```ruby
# as part of the action at /api/v1/student/:student_id/lessons/:id
Student.all.where(uuid: params[:student_id]).lessons.where(uuid: params[:id]).query.some_complex_match
```
I changed `match_to` to allow strings and integers, so you can replace that with this:
```ruby
Student.all.match_to(params[:student_id]).lessons.match_to(params[:id]).query.some_complex_match
```
It's a subtle difference but it prevents you from having to know and maintain consistency between the primary key of each model and your Cypher query.

I also changed it so if you give it nil, it generates Cypher using `where 1 = 2`. The default QueryProxy behavior when `nil` is send to `where` is to remove `where` completely, so `Student.all.where(nil).first` will return every Student. This doesn't feel right for `match_to`... but I'm also not thrilled that this may feel like an API inconsistency, so I'm open to changing this if it doesn't sit well with anyone.

Gonna merge it as is now, we can update it sometime before next version's release if needed.