Hi, when I use what you said it's working but I have a 'tire_id' in the SQL DB and then I can't save... Any way to suppress it?
On Mar 23, 4:18 pm, Jonathan Stott <[email protected]> wrote: > 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' > > > ClassTire > > 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 atire, 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.
