From cc48bdc87ed2ac93df985d0114a0ba92eff5b24d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Thomsen?= Date: Fri, 11 Oct 2019 15:50:08 -0300 Subject: [PATCH 1/3] Change boot method to static Updated the boot method to comply with AdonisJS --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e35ae63..b196036 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Add the following to your model's `boot` method: ```js class MyModel extends Model { - boot () { + static boot () { super.boot() this.addTrait('@provider:Auditable') } @@ -76,4 +76,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file - Added this changelog. - v1.0.1 - - Initial release. \ No newline at end of file + - Initial release. From 00cef475cc985ec018c013c619a0d7c3cb685a0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Thomsen?= Date: Fri, 11 Oct 2019 15:51:24 -0300 Subject: [PATCH 2/3] Change absoluteUrl() to originalUrl() --- src/Traits/Auditable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Traits/Auditable.js b/src/Traits/Auditable.js index 68fb4b1..15df731 100644 --- a/src/Traits/Auditable.js +++ b/src/Traits/Auditable.js @@ -123,7 +123,7 @@ async function createAudit (event, {request, auth}, auditable, auditableId, oldD // get user data to store const userId = _.get(auth, 'user.id', null) - const url = request.absoluteUrl() + const url = request.originalUrl() const ip = request.ip() // save audit From b06d0515668e912fbe89b479d608256e0e67c10a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Thomsen?= Date: Fri, 11 Oct 2019 15:53:20 -0300 Subject: [PATCH 3/3] Update readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b196036..4428c75 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,9 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file ## Changelog - +- v2.0.2 + - Fixed bugs for AdonisJS 4.1. + - v2.0.1 - Removed need to pass in `ctx` parameters. - Update README and instructions.md files.