Skip to content

The type of a polymorphic belongsTo is serialized properly. #1267

Closed
wants to merge 1 commit into from

3 participants

@cyril-sf

[Fixes #881]

@bradleypriest
Ember.js member

@Cyril-sf I've added a hook to customize the polymorphic serialization in #1263. Should be in sometime today.

@bradleypriest
Ember.js member

This PR will need updating once that's in.

@cyril-sf

@bradleypriest seems good, but we still need to fix the default value. I'll take care of updating my PR once yours is merged

@wycats
Ember.js member
wycats commented Sep 11, 2013

Shouldn't this be moved into the hook in AMSerializer and just leave the hook in the JSONSerializer?

@wycats
Ember.js member
wycats commented Sep 11, 2013

@Cyril-sf can you write some docs on the expected normalized form of polymorphic associations for the guide?

@cyril-sf

@wycats totally, it doesn't make sense to talk about polymorphic associations in the JSONSerializer.

I'll change that and write some docs.

@cyril-sf

@wycats Is anyone currently working on the ActiveModelSerializer?

@bradleypriest
Ember.js member

@Cyril-sf It's pretty much done #1206

@wycats
Ember.js member
wycats commented Sep 12, 2013

@Cyril-sf what's the status of this? The AMSerializer is waiting on this PR 😉

@bradleypriest
Ember.js member

@wycats I'd already implemented this in AMS, this PR is just about whether to put it in the REST as well

@cyril-sf

@wycats The code is ready in @bradleypriest PR. I'll update today this PR to move that code in the REST serializer.

As for the documentation, updating the "Connecting to an HTTP Server" is ok for you?

@wycats
Ember.js member
wycats commented Sep 13, 2013

@Cyril-sf Yes to both.

@wycats
Ember.js member
wycats commented Sep 16, 2013

@Cyril-sf status?

@cyril-sf

@wycats @bradleypriest seems to have pushed everything for both adapters.

I've started to write the documentation https://github.com/Cyril-sf/website/tree/polymorphic_associations.

@bradleypriest
Ember.js member

The current difference between AMS and REST is that AMS capitalizes the polymorphic type as well.
The REST default is probably good enough for now though

@wycats wycats closed this Sep 17, 2013
@wycats
Ember.js member
wycats commented Sep 17, 2013

@Cyril-sf I'm closing then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.