Sha256: f6fa45e0674d9b6ef5c91501debb4ab86e92c51e873a1443899a2d4f20fd3b35
Contents?: true
Size: 709 Bytes
Versions: 2
Compression:
Stored size: 709 Bytes
Contents
# frozen_string_literal: true module Decidim module ParticipatoryDocuments # This class serializes a Suggestion so can be exported to CSV, JSON or other # formats. class MySuggestionSerializer < SuggestionSerializer # Public: Exports a hash with the serialized data for this suggestion. def serialize { id: suggestion.id, body: suggestion_body(suggestion), author: suggestion.try(:normalized_author).try(:name), state: humanize_suggestion_state(suggestion.state), answer: answer_text(suggestion), section: section(suggestion), submitted_on: submitted_on(suggestion) } end end end end
Version data entries
2 entries across 2 versions & 1 rubygems