Ghost/core/client/app/serializers/application.js
Austin Burdine 28d265c9c1 update Ember to 1.12.1/ember-data to 1.0.0-beta.18
No issue
- fixed "{{#each}}" helper in templates to use block syntax
- fixed deprecated ember.controller getter/setter function to use new syntax
- removed unnecessary pass-protect route view
2015-06-02 22:26:16 -06:00

21 lines
592 B
JavaScript

import Ember from 'ember';
import DS from 'ember-data';
var ApplicationSerializer = DS.RESTSerializer.extend({
serializeIntoHash: function (hash, type, record, options) {
// Our API expects an id on the posted object
options = options || {};
options.includeId = true;
// We have a plural root in the API
var root = Ember.String.pluralize(type.modelName),
data = this.serialize(record, options);
// Don't ever pass uuid's
delete data.uuid;
hash[root] = [data];
}
});
export default ApplicationSerializer;