about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-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