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:
Hannah Wolfe 2016-05-23 09:07:20 +01:00
commit 38e3654bbe

View File

@ -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 {