Commit 04c3599a authored by Takeshi Umeda's avatar Takeshi Umeda
Browse files

Does not list tags with an underscore at the end

parent 72037c9b
......@@ -50,6 +50,8 @@ class Tag < ApplicationRecord
:decrement_count!,
to: :account_tag_stat
before_save :set_unlistable, if: :force_unlistable?
after_save :save_account_tag_stat
update_index('tags#tag', :self)
......@@ -84,6 +86,10 @@ class Tag < ApplicationRecord
alias trendable? trendable
def force_unlistable?
name.end_with?('_')
end
def requires_review?
reviewed_at.nil?
end
......@@ -165,6 +171,10 @@ class Tag < ApplicationRecord
private
def set_unlistable
self.listable = false
end
def save_account_tag_stat
return unless account_tag_stat&.changed?
account_tag_stat.save
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment