discourse/app/serializers/watched_word_serializer.rb
Bianca Nenciu 437c9a554b
FEATURE: Import and export watched word (#12444)
Find & Replace and Autotag watched words were not completely exported
and import did not work with these either. This commit changes the
input and output format to CSV, which allows for a secondary column.

This change is backwards compatible because a CSV file with only one
column has one value per line.
2021-03-22 22:32:18 +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?
WatchedWord.has_replacement?(action)
end
end