downstairs
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -134,3 +134,3 @@ var Table = {} | ||
var result = false; | ||
if (results.rowCount > 0 && results.command === 'UPDATE') { | ||
if (results && results.rowCount > 0 && results.command === 'UPDATE') { | ||
result = true; | ||
@@ -137,0 +137,0 @@ } |
{ | ||
"name": "downstairs", | ||
"description": "A light ORM wrapped about brianc's node-sql and node-pg", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"homepage": "https://github.com/moneytribeaustralia/downstairs.js", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -61,3 +61,3 @@ var Downstairs = require('../lib/downstairs') | ||
describe('Table level behaviours', function() { | ||
describe('Table level behaviours', function(done) { | ||
beforeEach(function(done){ | ||
@@ -142,2 +142,10 @@ helper.resetDb(helper.userTableSQL, done); | ||
}) | ||
it('checks for results in an update result before trying to access them', function(done){ | ||
var User = Table.model('User', userSQL); | ||
User.update({}, {username: 'noMatch'}, function(err, user){ | ||
should.exist(err); | ||
done(); | ||
}); | ||
}) | ||
}); |
44371
999