On 19 October 2010 21:29, Greg Willits <[email protected]> wrote:
> Colin Law wrote in post #955556:
>> On 19 October 2010 21:06, Greg Willits <[email protected]> wrote:
>>> 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.)
>>
>> I do not understand what you mean by 'there is no through involved'.
>> In the situation described you may say
>> Aaa :has_many :cccs, :through => :bbbs
>> then you may use aaa.cccs
>
> My existing schema does not match the example laid out here:
> http://guides.rubyonrails.org/association_basics.html#the-has_many-through-association
>
> I do not have one table capable of pointing in parallel to two tables as
> diagramed. The schema I am working with is strictly A->B->C  and not
> A->B and A->C.

It is unfortunate that the guide does not have a diagram for the
situation you describe as it is a very common case.  It is described
in the text just below but there is no diagram to draw one's attention
to it.

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to