From 6d9a8f790cc6bf063538b908319509aee57ef966 Mon Sep 17 00:00:00 2001 From: Cody Stoltman Date: Fri, 18 Mar 2016 18:53:46 -0500 Subject: [PATCH] fix for #1326 --- lib/waterline/utils/normalize.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/waterline/utils/normalize.js b/lib/waterline/utils/normalize.js index 9192ea128..dbedad1d2 100644 --- a/lib/waterline/utils/normalize.js +++ b/lib/waterline/utils/normalize.js @@ -44,6 +44,10 @@ var normalize = module.exports = { if (options && options[pk]) { var coercePK; + if(!context.attributes[pk]) { + return pk; + } + if (context.attributes[pk].type == 'integer') { coercePK = function(pk) {return +pk;}; } else if (context.attributes[pk].type == 'string') {