mirror of
https://github.com/discourse/discourse.git
synced 2025-02-23 01:47:42 +08:00

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.
14 lines
268 B
Ruby
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
|