about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2019-08-07 10:00:58 +0200
committerGitHub <noreply@github.com>2019-08-07 10:00:58 +0200
commita8958d07e222f2aa6867e8a5bf93cce4535fd3ce (patch)
tree28bf1bd8c3c608f697a2eef9822268f82ce55964 /app
parentdd38c280a50a8feb70ad341c3561fe2f87c8cf3d (diff)
Fix featured tags not finding the right tag on save (#11504)
Regression from f371b32
Diffstat (limited to 'app')
-rw-r--r--app/javascript/styles/mastodon/widgets.scss7
-rw-r--r--app/models/featured_tag.rb2
2 files changed, 7 insertions, 2 deletions
diff --git a/app/javascript/styles/mastodon/widgets.scss b/app/javascript/styles/mastodon/widgets.scss
index acaf5b024..8c30bc57c 100644
--- a/app/javascript/styles/mastodon/widgets.scss
+++ b/app/javascript/styles/mastodon/widgets.scss
@@ -324,7 +324,8 @@
     &.active h4 {
       &,
       .fa,
-      small {
+      small,
+      .trends__item__current {
         color: $primary-text-color;
       }
     }
@@ -337,6 +338,10 @@
     &.active .avatar-stack .account__avatar {
       border-color: $ui-highlight-color;
     }
+
+    .trends__item__current {
+      padding-right: 0;
+    }
   }
 }
 
diff --git a/app/models/featured_tag.rb b/app/models/featured_tag.rb
index d06ae26a8..e02ae0705 100644
--- a/app/models/featured_tag.rb
+++ b/app/models/featured_tag.rb
@@ -23,7 +23,7 @@ class FeaturedTag < ApplicationRecord
   validate :validate_featured_tags_limit, on: :create
 
   def name=(str)
-    self.tag = Tag.find_or_initialize_by(name: str.strip.delete('#').mb_chars.downcase.to_s)
+    self.tag = Tag.find_or_create_by_names(str.strip)&.first
   end
 
   def increment(timestamp)