diff --git a/index.js b/index.js index ed7faee..3f7e565 100644 --- a/index.js +++ b/index.js @@ -169,6 +169,10 @@ function removeDuplicateRecords(collection) { */ function jsonapify(data, model, selfUrl, context) { const includedData = []; + if (model.attributes === undefined) { + model.attributes = model.rawAttributes; + } + const idAttribute = Object.keys(model.attributes).filter(byPrimaryKey(model))[0]; const excluded = [idAttribute];