On 18 Oct 2011 12:56, "Chris" <[email protected]> wrote:
>
> There are some Meals and each meal has many sides.
>
> But it's only this single direction - so a side don't need to belong
> to the meal. I don't wanna search: "Give me the meals where side
> is ..."
>
> So one Side could be associated with many meals.
>
> But I'm not shure how to create this with active Record.
>

You want a habtm relationship, or a :through a join model (named like
'Siding' to demonstrate its intention to link Side to something).
Consider also that i may order two sides of the same item with one main...
you need a join table to model that.

-- 
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