Skip to content

Commit

Permalink
Merge pull request #8 from trey-baker/master
Browse files Browse the repository at this point in the history
Update for compatibility with Objection 1.0.0
  • Loading branch information
nunorafaelrocha authored Mar 1, 2018
2 parents 4d883dc + 2a95cc9 commit 44c9f36
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 32 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ try {
These options can be provided when instantiating the plugin:

```js
const unique = require('objection-unique')(
const unique = require('objection-unique')({
fields: ['email', 'username'],
identifiers: ['id']
);
});
```

## Tests
Expand Down
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ module.exports = options => {
const errors = this.parseErrors(rows);

if (!isEmpty(errors)) {
throw Model.createValidationError(errors);
throw Model.createValidationError({
data: errors,
type: 'ModelValidation'
});
}
});
}
Expand Down
67 changes: 39 additions & 28 deletions 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
Expand Up @@ -54,7 +54,7 @@
"jest": "^20.0.3",
"knex": "^0.13.0",
"lint-staged": "^3.4.1",
"objection": "^0.8.5",
"objection": "^1.0.0",
"pre-commit": "^1.2.2",
"sqlite3": "^3.1.8"
},
Expand Down

0 comments on commit 44c9f36

Please sign in to comment.