let's say that we have models, A, B, and C
A is 1:N to B
B is 1:N to C
How would I use a query开发者_开发百科 to return the subset of C such that the owner of each C is one of the Bs owned by A?
essentially How to specify multiple values in where with AR query interface in rails3 but that's unanswered
You have to do a :through association:
A has_one C, :through => B
and then you would be able to do A.C
精彩评论