Open bobholt opened 8 years ago
Thanks for the feedback @wraithgar. Additional commits to address those issues.
I think I've asked all the questions I had when looking at this PR. Would love more eyeballs on this.
I've found some issues with this in production. I should be close to resolving, then will update this PR.
fixes #52
When calling the
save()
method withwait: true
andpatch: true
, the current implmentation assumes a basic data structure and ignored the structure generated by an overriddenserialize
method.This fix invokes the
serialize()
method to ensure the user's data structure is respected. In order for this to work withPATCH
, we have to inspect that structure to find where the attributes have been placed, and then limit the properties of those object to only the ones changed.This still makes some assumptions about the data structure (namely that all attributes appear within a single object within the serialized structure), but hopefully less restrictive ones than the current implementation.