File a bug report in dm-core on github and see what response you get.  It may 
just be that nobody's ever spec'd the behaviour with respect to the order in 
which validations and save are done.

But as an immediate workaround, I'd just do the validation manually before you 
move call #save.  I agree, it does seem like unexpected behaviour.  The 
transaction rollback leaving the object in a broken state is almost certainly a 
bug.

On 26/06/2011, at 19:19, 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.

Reply via email to