Class: Decidim::Forms::DownloadYourDataUserAnswersSerializer
- Inherits:
-
Exporters::Serializer
- Object
- Exporters::Serializer
- Decidim::Forms::DownloadYourDataUserAnswersSerializer
- Includes:
- TranslationsHelper
- Defined in:
- lib/decidim/forms/download_your_data_user_answers_serializer.rb
Instance Method Summary collapse
-
#serialize ⇒ Object
Serializes an user answer for download your data.
Instance Method Details
#serialize ⇒ Object
Serializes an user answer for download your data
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/decidim/forms/download_your_data_user_answers_serializer.rb', line 8 def serialize { id: resource.id, user: { name: resource.user.name, email: resource.user.email }, questionnaire: { id: resource.question.questionnaire.id, title: translated_attribute(resource.question.questionnaire.title), description: translated_attribute(resource.question.questionnaire.description), tos: translated_attribute(resource.question.questionnaire.tos) }, question: { id: resource.question.id, body: translated_attribute(resource.question.body), description: translated_attribute(resource.question.description) }, answer: normalize_body(resource) } end |