discourse/app/serializers/watched_word_list_serialize...

14 lines
243 B
Ruby
Raw Normal View History

class WatchedWordListSerializer < ApplicationSerializer
attributes :actions, :words
def actions
WatchedWord.actions.keys
end
def words
object.map do |word|
WatchedWordSerializer.new(word, root: false)
end
end
end