PostSetPresenters::Post#related_posts: clean up metatag parsing (#2894).

* Fix `#related_tags` to use `Tag.has_metatag?`.
* Fix Tag::SUBQUERY_METATAGS and Tag::METATAGS to be arrays instead of regexes.
This commit is contained in:
evazion
2018-09-20 14:42:10 -05:00
parent 6fe883c316
commit 29cdaddd86
5 changed files with 18 additions and 10 deletions

View File

@@ -24,7 +24,7 @@ module PostSetPresenters
related_tags_for_single(post_set.tag_string)
elsif post_set.unordered_tag_array.size == 1
related_tags_for_single(post_set.unordered_tag_array.first)
elsif post_set.tag_string =~ /(?:^|\s)(?:#{Tag::SUBQUERY_METATAGS}):\S+/
elsif Tag.has_metatag?(post_set.tag_array, *Tag::SUBQUERY_METATAGS)
calculate_related_tags_from_post_set
elsif post_set.is_empty_tag?
popular_tags