This repository has been archived on 2025-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
hymenobacterdotinfo/app/serializers/characteristic.js
2015-09-04 08:45:54 -07:00

18 lines
467 B
JavaScript

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'));
});
}
});