Hi There,
I got stuck in a Problem with Active Record Associations.
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 ..."
I'll show you the problem with an example:
Meal 1: Side_8 Side_10 Side_11
Meal 2: Side_2 Side_8 Side_10
So one Side could be associated with many meals.
But I'm not shure how to create this with active Record.
I thought it should be enough to do this:
class Meal < ActiveRecord::Base has_many :sides end
class Side < ActiveRecord::Base end
But the meal_id is saved at the Side - so a side will only belong to the last associated Meal - am I right?
Thanks allot for your help Chris