mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-30 06:19:03 +01:00
19 lines
377 B
Ruby
19 lines
377 B
Ruby
# frozen_string_literal: true
|
|
|
|
class REST::Admin::CohortSerializer < ActiveModel::Serializer
|
|
attributes :period, :frequency
|
|
|
|
class CohortDataSerializer < ActiveModel::Serializer
|
|
attributes :date, :percent, :value
|
|
|
|
def date
|
|
object.date.iso8601
|
|
end
|
|
end
|
|
|
|
has_many :data, serializer: CohortDataSerializer
|
|
|
|
def period
|
|
object.period.iso8601
|
|
end
|
|
end
|