downstairs
Advanced tools
Comparing version 0.3.4 to 0.3.5
@@ -41,3 +41,6 @@ var async = require('async') | ||
if (result){ | ||
return self._model.update(data, {id: self.id}, cb); | ||
if (!self.id) { | ||
self._model.create(data, cb); | ||
} | ||
else self._model.update(data, {id: self.id}, cb); | ||
} | ||
@@ -44,0 +47,0 @@ else { |
{ | ||
"name": "downstairs", | ||
"description": "A light ORM wrapped about brianc's node-sql and node-pg", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"homepage": "https://github.com/moneytribeaustralia/downstairs.js", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -325,3 +325,15 @@ var Downstairs = require('../lib/downstairs') | ||
}); | ||
it('parses multiple order bys', function(done){ | ||
var data = {password: '5f4dcc3b5aa765d61d8327deb882cf99', username: 'anthony', email: 'anthony@moneytribe.com.au'}; | ||
ectypes.User.create(data, function(err, user){ | ||
User.findAll({queryParameters: {orderBy: 'id ASC, username DESC'}}, function(err, users){ | ||
users[0].username.should.equal('andrew'); | ||
users[1].username.should.equal('zack'); | ||
users[2].username.should.equal('anthony'); | ||
done() | ||
}); | ||
}); | ||
}); | ||
}) | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108131
1649