Merge pull request #2753 from evazion/feat-autotag-cosplay

Autotag character_(cosplay) -> character, cosplay.
This commit is contained in:
Albert Yi
2016-11-11 16:48:30 -08:00
committed by GitHub
2 changed files with 19 additions and 1 deletions

View File

@@ -608,8 +608,8 @@ class Post < ActiveRecord::Base
normalized_tags = remove_negated_tags(normalized_tags)
normalized_tags = normalized_tags.map {|x| Tag.find_or_create_by_name(x).name}
normalized_tags = %w(tagme) if normalized_tags.empty?
normalized_tags = add_automatic_tags(normalized_tags)
normalized_tags = TagAlias.to_aliased(normalized_tags)
normalized_tags = add_automatic_tags(normalized_tags)
normalized_tags = TagImplication.with_descendants(normalized_tags)
normalized_tags.sort!
set_tag_string(normalized_tags.uniq.sort.join(" "))
@@ -678,6 +678,10 @@ class Post < ActiveRecord::Base
tags << "ugoira"
end
characters = tags.grep(/\A(.+)_\(cosplay\)\Z/) { $1 }
tags += characters
tags << "cosplay" if characters.present?
return tags
end