This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
2019-06-19 17:52:34 -07:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class REST::Admin::ReportSerializer < ActiveModel::Serializer
|
2022-06-09 12:57:36 -07:00
|
|
|
attributes :id, :action_taken, :action_taken_at, :category, :comment,
|
2022-06-27 00:30:15 -07:00
|
|
|
:forwarded, :created_at, :updated_at
|
2019-06-19 17:52:34 -07:00
|
|
|
|
|
|
|
has_one :account, serializer: REST::Admin::AccountSerializer
|
|
|
|
has_one :target_account, serializer: REST::Admin::AccountSerializer
|
|
|
|
has_one :assigned_account, serializer: REST::Admin::AccountSerializer
|
|
|
|
has_one :action_taken_by_account, serializer: REST::Admin::AccountSerializer
|
|
|
|
|
|
|
|
has_many :statuses, serializer: REST::StatusSerializer
|
2022-01-17 00:41:33 -08:00
|
|
|
has_many :rules, serializer: REST::RuleSerializer
|
2019-06-19 17:52:34 -07:00
|
|
|
|
|
|
|
def id
|
|
|
|
object.id.to_s
|
|
|
|
end
|
2022-01-17 00:41:33 -08:00
|
|
|
|
|
|
|
def statuses
|
|
|
|
object.statuses.with_includes
|
|
|
|
end
|
2019-06-19 17:52:34 -07:00
|
|
|
end
|