Skip to content

Commit

Permalink
Fix model equality test (dresende#293)
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Aug 10, 2013
1 parent fb5d0b5 commit 6765314
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]];
Expand Down

0 comments on commit 6765314

Please sign in to comment.