]> cat aescling's git repositories - mastodon.git/commitdiff
Fix tag mb_chars comparison of profile directory (#9448)
authorTakeshi Umeda <noel.yoshiba@gmail.com>
Fri, 7 Dec 2018 03:18:37 +0000 (12:18 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 7 Dec 2018 03:18:37 +0000 (04:18 +0100)
app/models/account.rb

index 20b0b72391a446edfd17eab0aef9c882e26978ca..c22836afe596ea7ee150c7e289f5cfa84ffb5212 100644 (file)
@@ -181,8 +181,8 @@ class Account < ApplicationRecord
   end
 
   def tags_as_strings=(tag_names)
-    tag_names.map! { |name| name.mb_chars.downcase }
-    tag_names.uniq!(&:to_s)
+    tag_names.map! { |name| name.mb_chars.downcase.to_s }
+    tag_names.uniq!
 
     # Existing hashtags
     hashtags_map = Tag.where(name: tag_names).each_with_object({}) { |tag, h| h[tag.name] = tag }
@@ -190,7 +190,7 @@ class Account < ApplicationRecord
     # Initialize not yet existing hashtags
     tag_names.each do |name|
       next if hashtags_map.key?(name)
-      hashtags_map[name.downcase] = Tag.new(name: name)
+      hashtags_map[name] = Tag.new(name: name)
     end
 
     # Remove hashtags that are to be deleted