about summary refs log tree commit diff
path: root/app/services/process_hashtags_service.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-07-28 05:59:51 +0200
committerGitHub <noreply@github.com>2019-07-28 05:59:51 +0200
commitf371b32137ccd7e74ca29d25af2072fb79654b15 (patch)
treed9ba19f1caab5674a5b4f828b39c938564aa142c /app/services/process_hashtags_service.rb
parent4cc29eb5ad106c267ff16c9f49f145bc34d1aae0 (diff)
Change hashtags to preserve first-used casing (#11416)
Diffstat (limited to 'app/services/process_hashtags_service.rb')
-rw-r--r--app/services/process_hashtags_service.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/services/process_hashtags_service.rb b/app/services/process_hashtags_service.rb
index b6974e598..e8e139b05 100644
--- a/app/services/process_hashtags_service.rb
+++ b/app/services/process_hashtags_service.rb
@@ -5,9 +5,7 @@ class ProcessHashtagsService < BaseService
     tags    = Extractor.extract_hashtags(status.text) if status.local?
     records = []
 
-    tags.map { |str| str.mb_chars.downcase }.uniq(&:to_s).each do |name|
-      tag = Tag.where(name: name).first_or_create(name: name)
-
+    Tag.find_or_create_by_names(tags) do |tag|
       status.tags << tag
       records << tag