diff --git a/lib/extends/serializers/proposals/proposals_serializer_extends.rb b/lib/extends/serializers/proposals/proposals_serializer_extends.rb index 480432b0..1d9e3d5a 100644 --- a/lib/extends/serializers/proposals/proposals_serializer_extends.rb +++ b/lib/extends/serializers/proposals/proposals_serializer_extends.rb @@ -33,6 +33,7 @@ def serialize }, comments: proposal.comments_count, attachments: proposal.attachments.count, + attachment_urls: attachment_urls, followers: proposal.followers.count, published_at: proposal.published_at, url: url, @@ -45,6 +46,12 @@ def serialize } } end + + def attachment_urls + proposal.attachments.map do |attc| + Rails.application.routes.url_helpers.rails_blob_url(attc.file.blob, host: proposal.participatory_space.organization.host) + end.join(",") + end end Decidim::Proposals::ProposalSerializer.class_eval do