I'm migrating a serializer to new ember cli modules.
I have a function that uses underscore, pluralize, and some find method of enumerable utils, but they are not current available inside the module.
How do you enable or import this to be accesible from my serializer?
import DS from 'ember-data';
function findGroupableItem(item, payload){
var associationKey = item.groupable_type.underscore().pluralize();
return payload[associationKey].find(function(object){
return object.id === item.groupable_id;
});
};
export default DS.ActiveModelSerializer.extend({
extract: function(store, type, payload, id, requestType){
//do something with findGroupableItem
}
});