Closed ierceg closed 3 years ago
Thanks for implementing this. If you have some more time, could you please add test which will modify object in adapter.save() and ensure that actual changes present in resulting object. We need it to prevent regression in future.
No problem. I'll add the tests when I get some time.
On Fri, Jan 24, 2014 at 7:01 AM, Anatoliy Chakkaev <notifications@github.com
wrote:
Thanks for implementing this. If you have some more time, could you please add test which will modify object in adapter.save() and ensure that actual changes present in resulting object. We need it to prevent regression in future.
— Reply to this email directly or view it on GitHubhttps://github.com/1602/jugglingdb/pull/364#issuecomment-33210541 .
Thank you, just ping me when you push, because github doesn't send notification on new commits to existing PR.
On Fri, Jan 24, 2014 at 10:04 AM, Ivan Erceg notifications@github.comwrote:
No problem. I'll add the tests when I get some time.
On Fri, Jan 24, 2014 at 7:01 AM, Anatoliy Chakkaev < notifications@github.com
wrote:
Thanks for implementing this. If you have some more time, could you please add test which will modify object in adapter.save() and ensure that actual changes present in resulting object. We need it to prevent regression in future.
— Reply to this email directly or view it on GitHub< https://github.com/1602/jugglingdb/pull/364#issuecomment-33210541> .
— Reply to this email directly or view it on GitHubhttps://github.com/1602/jugglingdb/pull/364#issuecomment-33210673 .
The invocation of
inst._adapter().save
passes a data object that is immediately discarded so even if the adapter changes the data object during the saving (e.g. sets a new revision) it has no effect ininst._initProperties(data, false);
as thatdata
object was never changed (nor could it be as adapter never had access to it).I fixed this problem by keeping a reference to the adapted data object and then using that object to update
inst
.