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

can.Model.model attribute serialization fix #449

Merged
merged 1 commit into from
Jul 18, 2013
Merged

Conversation

zkat
Copy link
Contributor

@zkat zkat commented Jul 16, 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

This should fix #444.

@daffl
Copy link
Contributor

daffl commented Jul 17, 2013

That makes sense. Can you add a test and somehow reference the original issue (something like "closes #444" in the commit message should do it). Thanks.

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
daffl added a commit that referenced this pull request Jul 18, 2013
can.Model.model attribute serialization fix
@daffl daffl merged commit 33dec94 into master Jul 18, 2013
@daffl daffl deleted the model-serializables branch July 18, 2013 22:24
@daffl
Copy link
Contributor

daffl commented Jul 18, 2013

👍 - Woot!

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.

.model should always serialize Observes
2 participants