show related tags for fav metatag

This commit is contained in:
albert
2013-02-18 20:50:38 -05:00
parent 02360c53c7
commit 8a46836238
3 changed files with 7 additions and 3 deletions

View File

@@ -47,7 +47,10 @@ module PostSetPresenters
tag = Tag.find_by_name(post_set.tag_string) tag = Tag.find_by_name(post_set.tag_string)
if tag if tag
return tag.related_tag_array.map(&:first) tag.related_tag_array.map(&:first)
else
tag = Tag.find_or_create_by_name(post_set.tag_string)
tag.related_tag_array.map(&:first)
end end
end end

View File

@@ -7,6 +7,7 @@
class TagSetPresenter < Presenter class TagSetPresenter < Presenter
def initialize(tags) def initialize(tags)
@tags = tags @tags = tags
puts @tags.inspect
end end
def tag_list_html(template, options = {}) def tag_list_html(template, options = {})

View File

@@ -191,8 +191,8 @@ module Danbooru
@canonical_tag_category_mapping ||= { @canonical_tag_category_mapping ||= {
"General" => 0, "General" => 0,
"Artist" => 1, "Artist" => 1,
"Copyright" => 2, "Copyright" => 3,
"Character" => 3 "Character" => 4
} }
end end