mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-06 13:18:14 +08:00
12 lines
287 B
Ruby
12 lines
287 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AiFeaturesAgentSerializer < ApplicationSerializer
|
|
attributes :id, :name, :allowed_groups
|
|
|
|
def allowed_groups
|
|
Group
|
|
.where(id: object.allowed_group_ids)
|
|
.pluck(:id, :name)
|
|
.map { |id, name| { id: id, name: name } }
|
|
end
|
|
end
|