search: clean up safe_mode / hide_deleted_posts settings.
Change PostQueryBuilder to add rating:s and -status:deleted to the search inside the constructor instead of inside `#build` and `#fast_count`. This lets up clean up `#fast_count` so it doesn't have to reparse the query after adding these tags. This caused aliases to be evaluated more than once on the post index page.
This commit is contained in:
@@ -4,7 +4,7 @@ module PostSets
|
||||
attr_reader :page, :random, :post_count, :format, :tag_string, :query
|
||||
|
||||
def initialize(tags, page = 1, per_page = nil, random: false, format: "html")
|
||||
@query = PostQueryBuilder.new(tags, CurrentUser.user)
|
||||
@query = PostQueryBuilder.new(tags, CurrentUser.user, safe_mode: CurrentUser.safe_mode?, hide_deleted_posts: CurrentUser.hide_deleted_posts?)
|
||||
@tag_string = tags
|
||||
@page = page
|
||||
@per_page = per_page
|
||||
|
||||
Reference in New Issue
Block a user