14 lines
341 B
Ruby
14 lines
341 B
Ruby
# frozen_string_literal: true
|
|
|
|
require_relative './rule_serializer'
|
|
|
|
class DiscourseChat::ChannelSerializer < ApplicationSerializer
|
|
attributes :id, :provider, :error_key, :error_info, :data, :rules
|
|
|
|
def rules
|
|
object.rules.order_by_precedence.map do |rule|
|
|
DiscourseChat::RuleSerializer.new(rule, root: false)
|
|
end
|
|
end
|
|
end
|