disapprovals: fix searching by user.
Fix searching post disapprovals by user to use the new `visible_for_search` mechanism. This fixes it so you can do subsearches on the user field, like this: * https://danbooru.donmai.us/post_disapprovals?search[user][level]=32 (find disapprovals by Builder-level approvers)
This commit is contained in:
@@ -1209,7 +1209,7 @@ class Post < ApplicationRecord
|
||||
where(disapprovals: PostDisapproval.where(reason: query.downcase))
|
||||
else
|
||||
user = User.find_by_name(query)
|
||||
where(disapprovals: PostDisapproval.creator_matches(user, current_user))
|
||||
where(disapprovals: PostDisapproval.visible_for_search(:user, current_user).where(user: user))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user