neumino/thinky — pull request #76 by mshick (2014-05-13 16:48:07+00:00)
Title: nested join chaining in hasAndBelongsToMany rels

Here's an attempt. It is working for me.

Most of the changes are just my reformatting the functions so I could see what was going on. The main bit of getJoin() I pulled from the hasMany query.