Interesting.  I guess DM is not walking the entire object tree in the 
validation step, before moving to the save step, and is instead walking the 
tree doing validate, save, validate, save... etc.  What happens if you 
expressly invoke valid? before going ahead and calling save?

> Why not stick booking_driver.save into a
> 
> after :create do |booking|
>    booking_driver = BookinDriver.new :booking => booking.id (or just
> booking? Not sure)
>    booking_driver.save
> end

Juan has indicated that Booking should not knowing anything about BookingDriver 
and that it is the other way around, so this would be a hack that, when new 
types of Booking are added, starts to get messy.  DM already walks the object 
tree and saves all the associations before saving the resource you called save 
on.

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

Reply via email to