On Tue, 23 Mar 2010 03:08:53 -0700 (PDT) Sylvain <[email protected]> wrote:
> Hi all, > I'm having the following model: > > Class Car > has 1 :front_left_tire, 'Tire' > has 1 :front_right_tire, 'Tire' > has 1 :back_left_tire, 'Tire' > has 1 :back_right_tire, 'Tire' > > Class Tire > belongs_to :car > > > when I do > > tire = Tire.new > car.front_left_tire = car > tire.save > > if after I look at for example car.back_right_tire, the object is > equal to front_left_tire :/ > > Instead of having 4 differents objects, I have 4 differents way to > access the same object... > > So, the question is, how do I do it? > > thanks in advance, > I suspect the answer might be 'counter-intuitively'. Having the car belong_to a tire, which has 1 car should get the result you expect. Regards Jon -- You received this message because you are subscribed to the Google Groups "DataMapper" 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/datamapper?hl=en.
