0
0
Fork 0

Fix featured tags not finding the right tag on save (#11504)

Regression from f371b32
This commit is contained in:
Eugen Rochko 2019-08-07 10:00:58 +02:00 committed by GitHub
parent dd38c280a5
commit a8958d07e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View 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)