2015-02-12 23:22:32 -05:00
|
|
|
import Ember from 'ember';
|
|
|
|
import DS from 'ember-data';
|
2014-06-09 06:02:51 -05:00
|
|
|
var ApplicationSerializer = DS.RESTSerializer.extend({
|
2014-05-09 00:00:10 -05:00
|
|
|
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.typeKey),
|
|
|
|
data = this.serialize(record, options);
|
|
|
|
|
|
|
|
// Don't ever pass uuid's
|
|
|
|
delete data.uuid;
|
|
|
|
|
|
|
|
hash[root] = [data];
|
|
|
|
}
|
2014-06-09 06:02:51 -05:00
|
|
|
});
|
|
|
|
|
|
|
|
export default ApplicationSerializer;
|