Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.model should always serialize Observes #444

Closed
daffl opened this issue Jul 3, 2013 · 0 comments · Fixed by #449
Closed

.model should always serialize Observes #444

daffl opened this issue Jul 3, 2013 · 0 comments · Fixed by #449
Milestone

Comments

@daffl
Copy link
Contributor

daffl commented Jul 3, 2013

The check in https://github.com/bitovi/canjs/blob/master/model/model.js#L1028:

if ( attributes instanceof this ) {
    attributes = attributes.serialize();
}

Should check for instanceof can.Observe and serialize any Observe since running an Observe through .model causes an error.

zkat pushed a commit that referenced this issue Jul 17, 2013
Instead of checking instanceof, just check if it's something with a
serialize function attached to it. This allows can.Model.model to
accept can.Observe (and anything else that's "serializable").

This does have the side-effect that "serialize" becomes a reserved
property, but there's other parts of canjs where this happens, such as
can.Observe#bind

Fixes #444
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant