Sha256: c263eb9c1b47f91ab42c153ed3178abb82662775841bec2b78238a966fb0cc1b
Contents?: true
Size: 816 Bytes
Versions: 25
Compression:
Stored size: 816 Bytes
Contents
# frozen_string_literal: true module Decidim module Meetings class DownloadYourDataUserAnswersSerializer < Decidim::Exporters::Serializer include Decidim::TranslationsHelper # Serializes an user answer for download your data def serialize { id: resource.id, user: { name: resource.user.name, email: resource.user.email }, questionnaire: { id: resource.question.questionnaire.id }, question: { id: resource.question.id, body: translated_attribute(resource.question.body) }, answer: normalize_body(resource) } end private def normalize_body(resource) resource.choices.pluck(:body) end end end end
Version data entries
25 entries across 25 versions & 1 rubygems