Edit characteristic

This commit is contained in:
Matthew Dillon 2015-09-04 08:45:54 -07:00
parent 24c870353f
commit f25fae0a83
6 changed files with 65 additions and 6 deletions

View file

@ -0,0 +1,18 @@
import DS from 'ember-data';
import Ember from 'ember';
export default DS.RESTSerializer.extend({
isNewSerializerAPI: true,
serializeHasMany: function(snapshot, json, relationship) {
var key = relationship.key;
var hasMany = snapshot.hasMany(key);
key = this.keyForRelationship ? this.keyForRelationship(key, "hasMany", "serialize") : key;
json[key] = [];
hasMany.forEach((item) => {
json[key].push(+item.get('id'));
});
}
});