forked from e621ng/e621ng
[Cleanup] Remove is_metatag?
Metatags don't appear in post versions
This commit is contained in:
parent
f8529bc60d
commit
8d3bb3414d
@ -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?
|
||||
|
||||
|
@ -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]}
|
||||
|
Loading…
Reference in New Issue
Block a user