adonis-acl icon indicating copy to clipboard operation
adonis-acl copied to clipboard

Retrieving additional columns on pivot table (e.g.: updated_at on role_user)

Open stavrogin opened this issue 4 years ago • 0 comments

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

stavrogin avatar May 05 '20 15:05 stavrogin