Class: Decidim::Conferences::DataPortabilityConferenceInviteSerializer

Inherits:
Exporters::Serializer
  • Object
show all
Defined in:
app/serializers/decidim/conferences/data_portability_conference_invite_serializer.rb

Instance Method Summary collapse

Instance Method Details

#serializeObject

Serializes a conference invite for data portability



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'app/serializers/decidim/conferences/data_portability_conference_invite_serializer.rb', line 7

def serialize
  {
    id: resource.id,
    sent_at: resource.sent_at,
    accepted_at: resource.accepted_at,
    rejected_at: resource.rejected_at,
    user: {
      name: resource.user.name,
      email: resource.user.email
    },
    registration_type: {
      title: resource.registration_type.title,
      price: resource.registration_type.price
    },
    conference: {
      title: resource.conference.title,
      reference: resource.conference.reference,
      slogan: resource.conference.slogan,
      description: resource.conference.description,
      start_date: resource.conference.start_date,
      end_date: resource.conference.end_date,
      location: resource.conference.location,
      objectives: resource.conference.objectives
    }
  }
end