- fixed typo in updateOrCreate method.

- added views to do .all queries, it speeds up the query.
This commit is contained in:
Muneeb Samuels 2012-11-04 21:30:08 +02:00
parent 2cc1896864
commit a3f30a112a
1 changed files with 2 additions and 2 deletions

View File

@ -221,7 +221,7 @@ CradleAdapter.prototype.updateOrCreate = function(model, data, callback) {
if(err) { if(err) {
this.create(model, data, callback); this.create(model, data, callback);
} else { } else {
this.updateAttributes(mode, data.id, data, callback); this.updateAttributes(model, data.id, data, callback);
} }
}.bind(this) }.bind(this)
) )
@ -290,7 +290,7 @@ CradleAdapter.prototype.models = function(model, filter, callback, func) {
// {include_docs:true, limit: limit, skip: skip}, // {include_docs:true, limit: limit, skip: skip},
// errorHandler(callback, function(res, cb) { // errorHandler(callback, function(res, cb) {
// var docs = res.map(function(doc) { // var docs = res.map(function(doc) {
// return idealize(doc); // return idealize(doc);
// }); // });
// var filtered = filtering(docs, model, filter, this._models) // var filtered = filtering(docs, model, filter, this._models)