about summary refs log tree commit diff
path: root/app/models/featured_tag.rb
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2022-10-22 18:49:41 +0900
committerGitHub <noreply@github.com>2022-10-22 11:49:41 +0200
commit1d34eff63f65dd0809af172cf3b1ed5e24c62eaf (patch)
tree5408468998475d141f40405e899491b7378c3322 /app/models/featured_tag.rb
parent7c152acb2cc545a87610de349a94e14f45fbed5d (diff)
Add featured tag add/remove activity handler (#19408)
Diffstat (limited to 'app/models/featured_tag.rb')
-rw-r--r--app/models/featured_tag.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/featured_tag.rb b/app/models/featured_tag.rb
index b16c79ac7..4a8d7224a 100644
--- a/app/models/featured_tag.rb
+++ b/app/models/featured_tag.rb
@@ -22,6 +22,8 @@ class FeaturedTag < ApplicationRecord
   before_create :set_tag
   before_create :reset_data
 
+  scope :by_name, ->(name) { joins(:tag).where(tag: { name: HashtagNormalizer.new.normalize(name) }) }
+
   delegate :display_name, to: :tag
 
   attr_writer :name