Skip to content

Commit

Permalink
fix: model existence check
Browse files Browse the repository at this point in the history
  • Loading branch information
citycide committed Jan 6, 2017
1 parent 772b252 commit 5591860
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Expand Up @@ -53,8 +53,9 @@ class Trilogy {
query.then(() => {})
})
} else {
let exists = runQuery(this, check, true)
if (!exists) runQuery(this, query)
runQuery(this, check, true).then(exists => {
if (!exists) runQuery(this, query)
})
}

return model
Expand Down

0 comments on commit 5591860

Please sign in to comment.