can.Model.model attribute serialization fix #449

Merged
merged 1 commit into from Jul 18, 2013

Conversation

Projects
None yet
2 participants
@zkat
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Jul 17, 2013

Contributor

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.

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.

Josh Marchán
can.Model.model attribute serialization fix
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

Merge pull request #449 from bitovi/model-serializables
can.Model.model attribute serialization fix

@daffl daffl merged commit 33dec94 into master Jul 18, 2013

1 check passed

default The Travis CI build passed
Details

@daffl daffl deleted the model-serializables branch Jul 18, 2013

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Jul 18, 2013

Contributor

👍 - Woot!

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