adonis-acl
adonis-acl copied to clipboard
Retrieving additional columns on pivot table (e.g.: updated_at on role_user)
Hi,
I have to get the last update role assignment of a user, so I have created updated_at
timestamp.
When I perform a query such as
let users = (await this.model.query().with('roles').fetch()).toJSON()
when I loop on user.roles
, I can see the property "pivot" which contains user_id
and role_id
.
How can I enrich the "pivot" by adding the updated_at timestamp column that I have added?
Thanks