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

12 lines
297 B
Ruby
Raw Normal View History

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|
2017-08-01 15:53:39 -04:00
DiscourseChat::RuleSerializer.new(rule, root: false)
end
end
2017-08-01 15:53:39 -04:00
end