Browse files

added each to model

  • Loading branch information...
1 parent 0c99500 commit 290d01c0e1577426b74d83577acbf9a22a013ed2 @joeferner committed Oct 29, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/model.js
View
6 lib/model.js
@@ -459,6 +459,12 @@ exports.define = function (name, columnDefs) {
};
Model.all = persistUtil.bind('all', Model.all, Model);
+ Model.each = function (connection, callback) {
+ var query = this.using(connection);
+ return query.each.apply(query, arguments);
+ };
+ Model.each = persistUtil.bind('each', Model.each, Model);
+
Model.first = function (connection, callback) {
var query = this.using(connection);
return query.first.apply(query, arguments);

0 comments on commit 290d01c

Please sign in to comment.