Skip to content

Commit

Permalink
Merge pull request coresmart#178 from brunogonncalves/master
Browse files Browse the repository at this point in the history
resolve coresmart#177.
  • Loading branch information
zefhemel committed Aug 31, 2015
2 parents 899c529 + f43e2d8 commit f692c4e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/persistence.store.sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,11 @@ function config(persistence, dialect) {
}
}
var additionalQueries = [];
for(var p in meta.hasMany) {
if(meta.hasMany.hasOwnProperty(p)) {
additionalQueries = additionalQueries.concat(persistence.get(obj, p).persistQueries());
if(meta && meta.hasMany) {
for(var p in meta.hasMany) {
if(meta.hasMany.hasOwnProperty(p)) {
additionalQueries = additionalQueries.concat(persistence.get(obj, p).persistQueries());
}
}
}
executeQueriesSeq(tx, additionalQueries, function() {
Expand Down

0 comments on commit f692c4e

Please sign in to comment.