Skip to content

Conversation

@js62789
Copy link

@js62789 js62789 commented Feb 25, 2015

Trackit currently uses underscore's clone method to set original attributes, which is a shallow clone and not a deep clone. As a result, changing nested attributes in a model will also change the attributes in model._originalAttrs. When calling model.unsavedAttributes(), a comparison of the original attributes and current attributes will indicate that there are no unsaved attributes.

This implementation adds a _cloneAttributes method to perform a deep clone on the original attributes for a more accurate comparison when calling unsavedAttributes. Unfortunately, underscore doesn't have a deep clone method and has repeatedly refused implementing one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant