Revert hasMany change

This commit is contained in:
Anatoliy Chakkaev 2013-01-21 23:08:13 +07:00
parent ea01571450
commit 4d47d8348d
2 changed files with 0 additions and 19 deletions

1
.gitignore vendored
View File

@ -3,6 +3,5 @@ doc
coverage.html coverage.html
coverage coverage
v8.log v8.log
.idea**
.DS_Store .DS_Store

View File

@ -841,7 +841,6 @@ AbstractClass.hasMany = function hasMany(anotherClass, params) {
return {where: x}; return {where: x};
}, { }, {
find: find, find: find,
all: all,
destroy: destroy destroy: destroy
}); });
@ -860,23 +859,6 @@ AbstractClass.hasMany = function hasMany(anotherClass, params) {
}.bind(this)); }.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) { function destroy(id, cb) {
this.find(id, function (err, inst) { this.find(id, function (err, inst) {
if (err) return cb(err); if (err) return cb(err);