2
0

Fix handling of featured tag removal (#34887)

This commit is contained in:
Claire
2025-06-02 10:09:30 +02:00
committed by GitHub
parent d47199dd4b
commit 00b56932de
2 changed files with 50 additions and 17 deletions

View File

@@ -26,6 +26,8 @@ class FeaturedTag < ApplicationRecord
normalizes :name, with: ->(name) { name.strip.delete_prefix('#') }
scope :by_name, ->(name) { joins(:tag).where(tag: { name: HashtagNormalizer.new.normalize(name) }) }
before_validation :set_tag
before_create :reset_data