I have 3 models, A, B and C
and the classic 3 relations:
1) A --- has_and_belongs_to_many --- B
2) B has_many C
B - c1
- c2
- c3
...
3) C belong_to B
C - a1
Question:
How can I get C entries in relationship to an A entry ?
in other words, I have
a = A.find id
and I want C
I have
On 20 May 2010 15:00, Ale Ds li...@ruby-forum.com wrote:
Question:
How can I get C entries in relationship to an A entry ?
in other words, I have
a = A.find id
and I want C
You need to iterate over a's bs [1] collection, and return the related
cs. Then probably only return uniq c records
2 matches
Mail list logo