Aaa has_many Bbb and Bbb has_many Ccc. There is no :through involved.
Ccc table does not have a FK back to Aaa. (Legacy schema.)
An instance of aaa can easily query with aaa.bbb.find (or .paginate),
but aaa.bbb.ccc.paginate() doesn't work because Aaa has no knowledge of
What's the idiomatic way of dealing with this? Loop through
aaa.bbb.paginate results and generate N queries for Ccc and flatten the
array? Seems too brutish.
Not finding great answers via Google, everyone seems to do has_many
:through, and that just doesn't apply here.
Oh -- Rails 3, but using WillPaginate. If there's a paginate()
compatible way to do this, I need that. Second choice would be to use an
AR3 way to do it that won't work with paginate(), and I can hack my own
TIA for pointers.