discourse-ai/app/serializers/ai_features_agent_serializer.rb
2025-05-29 15:17:34 +10:00

13 lines
313 B
Ruby

# frozen_string_literal: true
class AiFeaturesAgentSerializer < ApplicationSerializer
attributes :id, :name, :system_prompt, :allowed_groups, :enabled
def allowed_groups
Group
.where(id: object.allowed_group_ids)
.pluck(:id, :name)
.map { |id, name| { id: id, name: name } }
end
end