]> cat aescling's git repositories - mastodon.git/commitdiff
Call uniq on the string version of mb_chars tags
authorEffy Elden <git@effy.is>
Sat, 21 Jan 2017 10:02:42 +0000 (21:02 +1100)
committerEffy Elden <git@effy.is>
Sat, 21 Jan 2017 10:02:42 +0000 (21:02 +1100)
app/services/process_hashtags_service.rb

index ddcc64aa590d2a4610bd0533ba2d31a508b8840c..8d7fbe92b6fd68db76f19f78e509058be6ca9738 100644 (file)
@@ -4,7 +4,7 @@ class ProcessHashtagsService < BaseService
   def call(status, tags = [])
     tags = status.text.scan(Tag::HASHTAG_RE).map(&:first) if status.local?
 
-    tags.map { |str| str.mb_chars.downcase }.uniq.each do |tag|
+    tags.map { |str| str.mb_chars.downcase }.uniq{ |t| t.to_s }.each do |tag|
       status.tags << Tag.where(name: tag).first_or_initialize(name: tag)
     end