Fix #4688: Malformed SQL when searching -status:any.
Negating `Post.all` produced the invalid SQL fragment `WHERE NOT ()`.
Use `Post.where("TRUE")` instead to produce `WHERE NOT (TRUE)`.
This commit is contained in:
@@ -290,7 +290,7 @@ class PostQueryBuilder
|
||||
when "unmoderated"
|
||||
Post.in_modqueue.available_for_moderation(current_user, hidden: false)
|
||||
when "all", "any"
|
||||
Post.all
|
||||
Post.where("TRUE")
|
||||
else
|
||||
Post.none
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user