I have a Proposal model and a Signature model.
Proposal has many signatures and Signature belongs to proposal
My relationships work fine when I select a single Proposal, but when I do a Proposal.search and return multiple proposals, I can't access signatures.
I want to sort my proposals by signatures count, so I tried this:
Proposal.find(:all, :limit => 3, :include => [:signatures])
Now when I debug(@proposals) I do see the corresponding signatures. How do I access them and write an :order => signatures.count ?
I'm not very familiar with includes / joins ...so let me know if I'm going about this the wrong way. Thanks.