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

@@ -242,8 +242,8 @@ class TagTest < ActiveSupport::TestCase
should_not allow_value("café").for(:name).on(:create)
should_not allow_value("東方").for(:name).on(:create)
metatags = Tag::METATAGS.split("|") + Tag::SUBQUERY_METATAGS.split("|") + TagCategory.mapping.keys
metatags.split("|").each do |metatag|
metatags = Tag::METATAGS + TagCategory.mapping.keys
metatags.each do |metatag|
should_not allow_value("#{metatag}:foo").for(:name).on(:create)
end
end