Class: Decidim::Solutions::SolutionSerializer

Inherits:
Exporters::Serializer
  • Object
show all
Includes:
ActionView::Helpers::SanitizeHelper, ApplicationHelper, ResourceHelper, TranslationsHelper, HtmlToPlainText
Defined in:
app/serializers/decidim/solutions/solution_serializer.rb

Instance Method Summary collapse

Instance Method Details

#serializeObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/serializers/decidim/solutions/solution_serializer.rb', line 12

def serialize
  {
    title_label => localized(resource.title),
    description_label => sanitized_description,
    status_label => resource&.project_status,
    challenge_label => translated_challenge_title,
    url_label => resource&.project_url,
    author_name_label => resource.author.name,
    author_email_label => resource.author.email,
    created_at_label => resource.created_at,
    published_at_label => resource&.published_at,
  }
end