Class: Decidim::DownloadYourDataSerializers::DownloadYourDataReportSerializer

Inherits:
Exporters::Serializer show all
Includes:
ResourceHelper
Defined in:
lib/decidim/download_your_data_serializers/download_your_data_report_serializer.rb

Instance Attribute Summary

Attributes inherited from Exporters::Serializer

#resource

Instance Method Summary collapse

Methods included from ResourceHelper

#linked_classes_filter_values_for, #linked_classes_for, #resource_locator

Methods inherited from Exporters::Serializer

#event_name, #finalize, #initialize, #run

Constructor Details

This class inherits a constructor from Decidim::Exporters::Serializer

Instance Method Details

#serializeObject

Public: Exports a hash with the serialized data for this conversation.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/decidim/download_your_data_serializers/download_your_data_report_serializer.rb', line 10

def serialize
  {
    id: resource.id,
    moderation: {
      id: resource.moderation.id,
      participatory_space: {
        id: resource.moderation.decidim_participatory_space_id,
        type: resource.moderation.decidim_participatory_space_type,
        title: resource.moderation.participatory_space.title
      },
      reportable_element: {
        id: resource.moderation.decidim_reportable_id,
        type: resource.moderation.decidim_reportable_type
      },
      hidden_at: resource.moderation.hidden_at,
      created_at: resource.moderation.created_at,
      updated_at: resource.moderation.updated_at
    },
    reason: resource.reason,
    details: resource.details,
    created_at: resource.created_at,
    updated_at: resource.updated_at
  }
end