discourse/app/serializers/watched_word_serializer.rb
Bianca Nenciu b49b455e47
FEATURE: Autotag watched words (#12244)
New topics with be matched against a set of watched words and be
tagged accordingly.
2021-03-03 10:53:38 +02:00

14 lines
268 B
Ruby

# frozen_string_literal: true
class WatchedWordSerializer < ApplicationSerializer
attributes :id, :word, :replacement, :action
def action
WatchedWord.actions[object.action]
end
def include_replacement?
action == :replace || action == :tag
end
end