You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like Person.Save() saves only first level relationships, just like the README says. However, second-level relationships are destroyed if they already exist.
The most inmediate fix would be to avoid this behaviour, making Update() ignore second-level relationships instead of deleting them.
As, in most cases, one would want to change just the relationship itself and not the whole depending object, a plain Update() function may be appreciated.
In fact, I think the case where you want to edit an object and its relatives in the same operation is fairly common for insertions, but relatively rare for updates. So making this new "plain update" the default behaviour and delegating the current "full update" operation to a different method might be worth considering.
The text was updated successfully, but these errors were encountered:
Looks like
Person.Save()
saves only first level relationships, just like the README says. However, second-level relationships are destroyed if they already exist.The most inmediate fix would be to avoid this behaviour, making
Update()
ignore second-level relationships instead of deleting them.As, in most cases, one would want to change just the relationship itself and not the whole depending object, a plain
Update()
function may be appreciated.In fact, I think the case where you want to edit an object and its relatives in the same operation is fairly common for insertions, but relatively rare for updates. So making this new "plain update" the default behaviour and delegating the current "full update" operation to a different method might be worth considering.
The text was updated successfully, but these errors were encountered: