-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Bug]: route serialize does not extract param off proxy #19298
Conversation
// has() { | ||
// return false; | ||
// } | ||
// }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put this example here in case we wanted a more general solution vs the ObjectProxy (which more closely resembles Ember-Data relationship)
} else { | ||
object[name] = get(model, name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conceptually this is pretty odd (e.g. if we were going to fall back to use get(model, name)
then we shouldn't check name in model
at the first branch above)
I think we could try to o something special like:
} else if (isProxy(model)) {
object[name] = get(model, name);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rwjblue as long as the helper util doesn't check for a symbol-ish thing that EmberData can't easily make use of (e.g. it checks for the well known proxy methods) then I don't see an issue with doing it this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@runspired ya, its basically anything that uses the proxy mixin
setProxy(this); |
de3d03f
to
a53a0ef
Compare
a53a0ef
to
40d5195
Compare
@@ -63,6 +63,8 @@ export function defaultSerialize( | |||
object[name] = get(model, name); | |||
} else if (/_id$/.test(name)) { | |||
object[name] = get(model, 'id'); | |||
} else if (isProxy(model)) { | |||
object[name] = get(model, name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also put this in the first if expression. Up to you if you feel having this final else if is better. Or perhaps it doesn't matter 😄 .
close emberjs/data#7380
name in model
does not work with our content in a Proxy.This does not work where
tag
is a ED relationship on@model
.