~cytrogen/masto-fe

ref: e6fd0de8400cd0c91cf5c0857b62aa5dc20b7dd1 masto-fe/app/serializers/rest/report_serializer.rb -rw-r--r-- 438 bytes
e6fd0de8 — Laura Hausmann Update patchset to upstream glitch 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# frozen_string_literal: true

class REST::ReportSerializer < ActiveModel::Serializer
  attributes :id, :action_taken, :action_taken_at, :category, :comment,
             :forwarded, :created_at, :status_ids, :rule_ids

  has_one :target_account, serializer: REST::AccountSerializer

  def id
    object.id.to_s
  end

  def status_ids
    object&.status_ids&.map(&:to_s)
  end

  def rule_ids
    object&.rule_ids&.map(&:to_s)
  end
end