Add graphs and retention metrics to admin dashboard (#16829)

This commit is contained in:
Eugen Rochko
2021-10-14 20:44:59 +02:00
committed by GitHub
parent 959f7fc580
commit 07341e7aa6
46 changed files with 1650 additions and 257 deletions

View File

@ -0,0 +1,19 @@
# 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