Skip to content

Commit

Permalink
Merge pull request #21 from sghribi/fix-destroy-all-non-persisted-models
Browse files Browse the repository at this point in the history
Fix destroy all on non persisted models
  • Loading branch information
sghribi authored May 29, 2018
2 parents 4e81f23 + f81d6bc commit 7524b4f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "loopback-fixtures",
"description": "Expressive fixtures generator for Loopback",
"version": "0.0.12",
"version": "0.0.13",
"dependencies": {
"async": "^2.0.0-rc.6",
"bluebird": "^3.4.1",
Expand Down
3 changes: 2 additions & 1 deletion src/fixtures-loader.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ module.exports =
purgeModelPromises = []

_.forEach models, (model) =>
purgeModelPromises.push @purgeModel(model)
if model.hasOwnProperty 'destroyAll'
purgeModelPromises.push @purgeModel(model)

Promise.all purgeModelPromises

Expand Down

0 comments on commit 7524b4f

Please sign in to comment.