Sha256: 2d2cb4a810f055b5d658faa431e787617f501129287984a7c8d673e96970d6ef

Contents?: true

Size: 1.24 KB

Versions: 56

Compression:

Stored size: 1.24 KB

Contents

# frozen_string_literal: true

module Decidim
  # This class serializes a Report so can be exported to CSV
  module DataPortabilitySerializers
    class DataPortabilityReportSerializer < Decidim::Exporters::Serializer
      include Decidim::ResourceHelper

      # Public: Exports a hash with the serialized data for this conversation.
      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
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
decidim-core-0.26.10 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.26.9 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.26.8 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.26.7 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.26.5 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.26.4 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.26.3 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.26.2 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.26.1 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.26.0 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.26.0.rc2 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.26.0.rc1 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.25.2 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.25.1 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.25.0 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.25.0.rc4 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.25.0.rc3 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.25.0.rc2 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.25.0.rc1 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb
decidim-core-0.24.3 lib/decidim/data_portability_serializers/data_portability_report_serializer.rb