[Cleanup] Remove is_metatag?

Metatags don't appear in post versions
This commit is contained in:
Earlopain 2023-08-20 18:27:40 +02:00
parent f8529bc60d
commit 8d3bb3414d
No known key found for this signature in database
GPG Key ID: 298A57787DC6EF08
2 changed files with 0 additions and 5 deletions

View File

@ -514,10 +514,6 @@ class Tag < ApplicationRecord
end
end
def is_metatag?(tag)
has_metatag?(tag, *METATAGS)
end
def has_metatag?(tags, *metatags)
return false if tags.blank?

View File

@ -172,7 +172,6 @@ class UserPresenter
def recent_tags_with_types
versions = PostVersion.where(updater_id: user.id).where("updated_at > ?", 1.hour.ago).order(id: :desc).limit(150)
tags = versions.flat_map(&:added_tags)
tags = tags.reject { |tag| Tag.is_metatag?(tag) }
tags = tags.group_by(&:itself).transform_values(&:size).sort_by { |tag, count| [-count, tag] }.map(&:first)
tags = tags.take(50)
Tag.where(name: tags).map {|x| [x.name, x.post_count, x.category]}