From 676531427faf66504539e4e4dc5c38d89b5b2b46 Mon Sep 17 00:00:00 2001 From: Benjamin Pannell Date: Sun, 11 Aug 2013 00:15:31 +0200 Subject: [PATCH] Fix model equality test (#293) --- lib/Utilities.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/Utilities.js b/lib/Utilities.js index bd6e4714..64fdb895 100644 --- a/lib/Utilities.js +++ b/lib/Utilities.js @@ -76,11 +76,10 @@ exports.checkConditions = function (conditions, one_associations) { // E) var association_fields = Object.keys(associations[k].field); var model = associations[k].model; - - + // F) for (i = 0; i < values.length; i++) { - if (values[i].isInstance && values[i].model() === model) { + if (values[i].isInstance && values[i].model().table == model.table) { if (association_fields.length == 1) { if (typeof conditions[association_fields[0]] == 'undefined') conditions[association_fields[0]] = values[i][model.id[0]];