]> cat aescling's git repositories - mastodon.git/commitdiff
Fix featured tags not finding the right tag on save (#11504)
authorEugen Rochko <eugen@zeonfederated.com>
Wed, 7 Aug 2019 08:00:58 +0000 (10:00 +0200)
committerGitHub <noreply@github.com>
Wed, 7 Aug 2019 08:00:58 +0000 (10:00 +0200)
Regression from f371b32

app/javascript/styles/mastodon/widgets.scss
app/models/featured_tag.rb

index acaf5b02404a7bdd0086e6560a24c337e97bcaf2..8c30bc57c9481a05026c2390635fe16fb300b44f 100644 (file)
     &.active h4 {
       &,
       .fa,
-      small {
+      small,
+      .trends__item__current {
         color: $primary-text-color;
       }
     }
     &.active .avatar-stack .account__avatar {
       border-color: $ui-highlight-color;
     }
+
+    .trends__item__current {
+      padding-right: 0;
+    }
   }
 }
 
index d06ae26a8902995bbfaa870812380703ff6b6a44..e02ae0705a2fceb71de5f4501205311ce5c6ca43 100644 (file)
@@ -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)