From 4d47d8348da40e72eba15de1406b2ce8feabcc12 Mon Sep 17 00:00:00 2001 From: Anatoliy Chakkaev Date: Mon, 21 Jan 2013 23:08:13 +0700 Subject: [PATCH] Revert hasMany change --- .gitignore | 1 - lib/abstract-class.js | 18 ------------------ 2 files changed, 19 deletions(-) diff --git a/.gitignore b/.gitignore index f3d45af1..64a8281a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,5 @@ doc coverage.html coverage v8.log -.idea** .DS_Store diff --git a/lib/abstract-class.js b/lib/abstract-class.js index 05121b4f..8167359c 100644 --- a/lib/abstract-class.js +++ b/lib/abstract-class.js @@ -841,7 +841,6 @@ AbstractClass.hasMany = function hasMany(anotherClass, params) { return {where: x}; }, { find: find, - all: all, destroy: destroy }); @@ -860,23 +859,6 @@ AbstractClass.hasMany = function hasMany(anotherClass, params) { }.bind(this)); } - function all(filter,cb) { - if (!filter) { - filter = {}; - } - if (!filter.where) { - filter.where = {}; - } - filter.where[fk] = this.id.toString(); - - anotherClass.all(filter,function(err,inst){ - if (err) return cb(err); - if (!inst) return cb(null,[]); - else return cb(null,inst); - - }.bind(this)); - } - function destroy(id, cb) { this.find(id, function (err, inst) { if (err) return cb(err);