restful-goose
Advanced tools
Comparing version 2.0.7 to 2.0.8
@@ -121,5 +121,5 @@ var _ = require('lodash'); | ||
var relationship = { links: { self: '/' + serialized.type + '/' + doc.id + '/relationships/' + toResourceType(rel.ref) }}; | ||
relationship.data = _.map(doc[rel.path], function(id) { | ||
relationship.data = _.chain(doc[rel.path]).reject(_.isNil).map(function(id) { | ||
return { type: toResourceType(rel.ref), id: id.toString() }; | ||
}); | ||
}).value(); | ||
_.set(serialized, 'relationships.' + rel.path, relationship); | ||
@@ -126,0 +126,0 @@ } else if (doc[rel.path] && !Array.isArray(doc[rel.path])) { |
{ | ||
"name": "restful-goose", | ||
"version": "2.0.7", | ||
"version": "2.0.8", | ||
"description": "A new improved version of your favorite API framework for mongoose/MongoDB", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
1090263