2023-03-22 23:29:08 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
module ::DiscourseDataExplorer
|
|
|
|
|
class QuerySerializer < ActiveModel::Serializer
|
2025-02-10 14:54:01 +11:00
|
|
|
attributes :id, :name, :description, :username, :group_ids, :last_run_at, :user_id
|
2023-03-22 23:29:08 +02:00
|
|
|
|
|
|
|
|
def username
|
|
|
|
|
object&.user&.username
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def group_ids
|
|
|
|
|
object.groups.map(&:id)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|