Merge pull request #4325 from BrokenEagle/related-tag-enhancements

Related tag enhancements
This commit is contained in:
evazion
2020-03-07 22:38:24 -06:00
committed by GitHub
6 changed files with 101 additions and 22 deletions

View File

@@ -41,7 +41,14 @@ class Tag < ApplicationRecord
end
def value_for(string)
TagCategory.mapping[string.to_s.downcase] || 0
norm_string = string.to_s.downcase
if norm_string =~ /#{TagCategory.category_ids_regex}/
norm_string.to_i
elsif TagCategory.mapping[string.to_s.downcase]
TagCategory.mapping[string.to_s.downcase]
else
0
end
end
end