Permalink
Browse files

fixed edge case on passing no callbacks

  • Loading branch information...
masylum committed May 8, 2012
1 parent ddecb3e commit 5fefbbb2a9894eeb0ad02547dcc6bb07821c2d25
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/helpers/collection_proxy.js
@@ -47,7 +47,10 @@ PROXY.proxy = function (model, options, args, callback) {
// driver method or hooks disabled
} else {
- args[args.length - 1] = callback;
+ if (!_.isFunction(args[args.length - 1])) {
+ args.push(callback);
+ }
+
_apply(collection, fn, args);
}
});

0 comments on commit 5fefbbb

Please sign in to comment.