From a8958d07e222f2aa6867e8a5bf93cce4535fd3ce Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 7 Aug 2019 10:00:58 +0200 Subject: Fix featured tags not finding the right tag on save (#11504) Regression from f371b32 --- app/models/featured_tag.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/featured_tag.rb') 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) -- cgit