Fix handling of featured tag removal (#34887)
This commit is contained in:
parent
d47199dd4b
commit
00b56932de
2 changed files with 50 additions and 17 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue