Welcome Guest, Not a member yet? Register   Sign In
Datamapper ORM, from_array with optional hasOne associations
#1

[eluser]Unknown[/eluser]
I'm reporting a problem with the from_array code of when a hasOne is optional. When a value is not set in the data, the code attempts to delete an old value for the association. However, if the value of the association was not previously set, a database error is throw about being unable to related models. The delete operation on line 165 needs to be protected by exists test on the old value.
#2

[eluser]WanWizard[/eluser]
Can you code up a fix? I don't have time to look into it at the moment.




Theme © iAndrew 2016 - Forum software by © MyBB