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

11 lines
283 B
Ruby
Raw Normal View History

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