Merge pull request #6875 from king6cong/role-id-fix
roles_users.id is not necessarily the same as roles_users.user_id
This commit is contained in:
commit
38e3654bbe
@ -284,7 +284,7 @@ User = ghostBookshelf.Model.extend({
|
||||
|
||||
query = this.forge(data, {include: options.include});
|
||||
|
||||
query.query('join', 'roles_users', 'users.id', '=', 'roles_users.id');
|
||||
query.query('join', 'roles_users', 'users.id', '=', 'roles_users.user_id');
|
||||
query.query('join', 'roles', 'roles_users.role_id', '=', 'roles.id');
|
||||
query.query('where', 'roles.name', '=', lookupRole);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user