不要怂,就是干,撸起袖子干!

Commit 9ed4f7a3 by Jan Aagaard Meier

Make it posible for success callbacks to emit two args to done

1 parent 94ec0379
...@@ -50,7 +50,7 @@ module.exports = (function() { ...@@ -50,7 +50,7 @@ module.exports = (function() {
function(fct) { function(fct) {
fct = bindToProcess(fct); fct = bindToProcess(fct);
this.on('error', function(err) { fct(err, null) }) this.on('error', function(err) { fct(err, null) })
.on('success', function(result) { fct(null, result) }) .on('success', function(arg0, arg1) { fct(null, arg0, arg1) })
return this return this
} }
......
...@@ -355,7 +355,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -355,7 +355,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
}; };
this.User.create(data).success(function (user) { this.User.create(data).success(function (user) {
self.User.findOrCreate(data).success(function (_user, created) { self.User.findOrCreate(data).done(function (err, _user, created) {
expect(_user.id).to.equal(user.id) expect(_user.id).to.equal(user.id)
expect(_user.username).to.equal('Username') expect(_user.username).to.equal('Username')
expect(_user.data).to.equal('ThisIsData') expect(_user.data).to.equal('ThisIsData')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!