This does seem to be a bug in dm-validations, as you surmised. I've seen two possible fixes floating around, one is in the association-validation branch of dm-validations (https://github.com/datamapper/dm-validations/commits/association-validation), and the other is in solnic's dm-validation-ext (https://github.com/solnic/dm-validations-ext). There is some discussion about this here: https://github.com/datamapper/dm-validations/pull/9
I haven't personally used either patch, but I've run into this bug as well, and I plan to evaluate these two patches soon. Good luck, and please report back your experiences! -- Emmanuel On Jun 26, 2011, at 2:19 AM, Juan wrote: > booking_driver.valid? is false before booking_driver.save, so as you said, > it seems it's not validating the object tree. > > It's a bug in DM? What sould I do? Don't save if it's not valid? > I think it should be done by the framework > > > > > > -- > 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. > -- 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.
