ryanb/cancan — pull request #806 by yuszuv (2013-01-20 16:37:30+00:00)
Title: added support for nested join conditions

There's a bug/feature incompleteness in the active_record_adapter, if you specify conditions via nested joins. E.g. if there's a comment model, that belongs_to a article, that belongs_to a category, you might to specify
```
can :read, Comment, :article => { :category => { :condition => true } }
```
At the moment the neccessary joins are extracted correctly by `CanCan::ModelAdapters::ActiveRecordAdapter#joins`, i.e. `{ :article => :category }`. But the conditions hash for the where clause is still nested, i.e. it becomes `{ :articles => { :categories => { :condition => true } } }`. My patch does correct this to `{ :categories => { :condition => true } }`.