downstairs
Advanced tools
Comparing version 0.3.1 to 0.3.2
@@ -332,3 +332,5 @@ var Collection = {} | ||
var record = this; | ||
model.find({id: this[foreignKeyName]}, function(err, one){ | ||
var query = {}; | ||
query[foreignKeyName] = record.id; | ||
model.find(query, function(err, one){ | ||
record[hasOneAssociationName] = one; | ||
@@ -351,3 +353,5 @@ cb(err, one); | ||
var record = this; | ||
model.findAll({id: this[foreignKeyName]}, function(err, all){ | ||
var query = {}; | ||
query[foreignKeyName] = record.id; | ||
model.findAll(query, function(err, all){ | ||
record[hasManyAssociationName] = all; | ||
@@ -354,0 +358,0 @@ cb(err, all); |
@@ -37,6 +37,7 @@ var async = require('async') | ||
var _model = this._model; | ||
var self = this; | ||
this.isValid(function(err, result){ | ||
if (result){ | ||
return _model.update(data, {id: this.id}, cb); | ||
return self._model.update(data, {id: self.id}, cb); | ||
} | ||
@@ -43,0 +44,0 @@ else { |
{ | ||
"name": "downstairs", | ||
"description": "A light ORM wrapped about brianc's node-sql and node-pg", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"homepage": "https://github.com/moneytribeaustralia/downstairs.js", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -14,3 +14,2 @@ var Downstairs = require('../lib/downstairs') | ||
describe('belongsTo', function(done){ | ||
beforeEach(function(done){ | ||
@@ -17,0 +16,0 @@ helper.resetDb(helper.userSQL + helper.roleSQL, 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
106274
1598