Created
January 23, 2015 05:37
-
-
Save baroquon/31f5d0a8aa11dd41d97c to your computer and use it in GitHub Desktop.
app/serializers/application.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import DS from 'ember-data'; | |
export default DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin, { | |
primaryKey: 'ID', | |
extractArray: function(store, type, payload) { | |
var payloadTemp = {}; | |
payloadTemp[type.typeKey] = payload; | |
return this._super(store, type, payloadTemp); | |
}, | |
extractSingle: function(store, type, payload, id) { | |
var payloadTemp = {}; | |
payloadTemp[type.typeKey] = [payload]; | |
return this._super(store, type, payloadTemp, id); | |
}, | |
attrs: { | |
items: { embedded: 'always' }, | |
acf: { embedded: 'always' } | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment