Fix #3995: Automatically imply *_school_uniform -> school_uniform.

This commit is contained in:
evazion
2018-12-05 12:19:27 -06:00
parent 7bbe4e8ac1
commit 7ae27c370d
2 changed files with 11 additions and 4 deletions

View File

@@ -28,8 +28,10 @@ class TagImplication < TagRelationship
end
def automatic_tags_for(names)
tags = names.grep(/\A(.+)_\(cosplay\)\Z/) { "char:#{TagAlias.to_aliased([$1]).first}" }
tags << "cosplay" if tags.present?
tags = []
tags += names.grep(/\A(.+)_\(cosplay\)\z/i) { "char:#{TagAlias.to_aliased([$1]).first}" }
tags << "cosplay" if names.any?(/_\(cosplay\)\z/i)
tags << "school_uniform" if names.any?(/_school_uniform\z/i)
tags.uniq
end
end