On 25 February 2013 18:03, PierreW <[email protected]> wrote: > Hi guys, > > In my Rails app, I have three models: A, B and C, with the following > relationships: > - B hasMany C > - C belongsTo B > > I would like A to "has_one" instance of B+C. By that I mean A needs to > be linked to a specific instance of B AND a specific instance of C.
You don't need to specify the A:B relationship. Just specify A has_one C, C belongs_to A (or the other way round if you prefer) then if you have a A in @a the C object is @a.c.b. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

