1
0
Fork 0
forked from gitea/nas

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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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