report_serializer.rb 438 B

1234567891011121314151617181920
  1. # frozen_string_literal: true
  2. class REST::ReportSerializer < ActiveModel::Serializer
  3. attributes :id, :action_taken, :action_taken_at, :category, :comment,
  4. :forwarded, :created_at, :status_ids, :rule_ids
  5. has_one :target_account, serializer: REST::AccountSerializer
  6. def id
  7. object.id.to_s
  8. end
  9. def status_ids
  10. object&.status_ids&.map(&:to_s)
  11. end
  12. def rule_ids
  13. object&.rule_ids&.map(&:to_s)
  14. end
  15. end