mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
f0d7a918a1
No Issue. - Ember-Data@1.0.0-beta.14.1. - Remove code from serializers for a workaround that's no longer needed.
20 lines
585 B
JavaScript
20 lines
585 B
JavaScript
import ApplicationSerializer from 'ghost/serializers/application';
|
|
|
|
var UserSerializer = ApplicationSerializer.extend(DS.EmbeddedRecordsMixin, {
|
|
attrs: {
|
|
roles: {embedded: 'always'}
|
|
},
|
|
|
|
extractSingle: function (store, primaryType, payload) {
|
|
var root = this.keyForAttribute(primaryType.typeKey),
|
|
pluralizedRoot = Ember.String.pluralize(primaryType.typeKey);
|
|
|
|
payload[root] = payload[pluralizedRoot][0];
|
|
delete payload[pluralizedRoot];
|
|
|
|
return this._super.apply(this, arguments);
|
|
}
|
|
});
|
|
|
|
export default UserSerializer;
|