Clarify ambiguous use of user_id column which was crashing search queries

This commit is contained in:
Toby Zerner 2018-10-23 07:23:41 +10:30
parent 90d4294456
commit d2a00225c7
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ class DiscussionPolicy extends AbstractPolicy
if (! $actor->hasPermission('discussion.approvePosts')) {
$query->where(function (Builder $query) use ($actor) {
$query->where('user_id', $actor->id)
$query->where('discussion.user_id', $actor->id)
->orWhere($this->canApprovePosts($actor));
});
}

View File

@ -52,7 +52,7 @@ class PostPolicy extends AbstractPolicy
if (! $actor->hasPermission('discussion.approvePosts')) {
$query->where(function (Builder $query) use ($actor) {
$query->where('user_id', $actor->id)
$query->where('posts.user_id', $actor->id)
->orWhereExists($this->discussionWhereCanApprovePosts($actor));
});
}