Skip to content

Commit

Permalink
Fix featured tags not finding the right tag on save (mastodon#11504)
Browse files Browse the repository at this point in the history
Regression from f371b32
Gargron authored and hiyuki2578 committed Oct 2, 2019

Verified

This commit was signed with the committer’s verified signature. The key has expired.
hiyuki2578 Shota Tsunehiro
1 parent be59814 commit 3551162
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion app/javascript/styles/mastodon/widgets.scss
Original file line number Diff line number Diff line change
@@ -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;
}
}
}

2 changes: 1 addition & 1 deletion app/models/featured_tag.rb
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 3551162

Please sign in to comment.