discourse-chat-integration/app/serializers/channel_serializer.rb

12 lines
297 B
Ruby

require_relative './rule_serializer'
class DiscourseChat::ChannelSerializer < ApplicationSerializer
attributes :id, :provider, :error_key, :data, :rules
def rules
object.rules.order_by_precedence.map do |rule|
DiscourseChat::RuleSerializer.new(rule, root: false)
end
end
end