related tags: refactor to take PostQuery instead of tag string.

Refactor RelatedTagCalculator and RelatedTagQuery to take a PostQuery
object instead of a raw tag string.

* Fixes the related tag sidebar on the post index page having to reparse
  the query and reevaluate aliases.
* Fixes related tags being affected by the current user's safe mode and
  hide deleted posts settings.
This commit is contained in:
evazion
2020-05-08 15:31:25 -05:00
parent 40e3ac14c0
commit 2749269d5b
4 changed files with 36 additions and 25 deletions

View File

@@ -40,7 +40,7 @@ module PostSetPresenters
end
def similar_tags
RelatedTagCalculator.cached_similar_tags_for_search(post_set.tag_string, MAX_TAGS, CurrentUser.user)
RelatedTagCalculator.cached_similar_tags_for_search(post_set.query, MAX_TAGS)
end
def frequent_tags