Class: Decidim::Meetings::RegistrationSerializer

Inherits:
Exporters::Serializer show all
Includes:
TranslationsHelper
Defined in:
decidim-meetings/app/serializers/decidim/meetings/registration_serializer.rb

Instance Attribute Summary

Attributes inherited from Exporters::Serializer

#resource

Instance Method Summary collapse

Methods included from TranslationsHelper

empty_translatable, ensure_translatable, multi_translation, translated_in_current_locale?

Methods included from TranslatableAttributes

#default_locale?

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

Serializes a registration


8
9
10
11
12
13
14
15
16
17
18
19
# File 'decidim-meetings/app/serializers/decidim/meetings/registration_serializer.rb', line 8

def serialize
  {
    id: resource.id,
    code: resource.code,
    user: {
      name: resource.user.name,
      email: resource.user.email,
      user_group: resource.user_group&.name || ""
    },
    registration_form_answers: serialize_answers
  }
end