diff --git a/app/serializers/decidim/api/rest_full/blog_component_serializer.rb b/app/serializers/decidim/api/rest_full/blog_component_serializer.rb index 97925e5..bd95e93 100644 --- a/app/serializers/decidim/api/rest_full/blog_component_serializer.rb +++ b/app/serializers/decidim/api/rest_full/blog_component_serializer.rb @@ -9,7 +9,7 @@ def self.resources_for(component, act_as) if act_as.nil? resources.published else - resources.published.or(resources.where(published_at: nil, decidim_user_id: act_as.id)) + resources.published.or(resources.where(published_at: nil, decidim_author_id: act_as.id)) end end has_many :resources, meta: (proc do |component, params| diff --git a/app/serializers/decidim/api/rest_full/proposal_component_serializer.rb b/app/serializers/decidim/api/rest_full/proposal_component_serializer.rb index 537884d..94b0a9d 100644 --- a/app/serializers/decidim/api/rest_full/proposal_component_serializer.rb +++ b/app/serializers/decidim/api/rest_full/proposal_component_serializer.rb @@ -9,7 +9,12 @@ def self.resources_for(component, act_as) if act_as.nil? resources.published else - resources.published.or(resources.where(published_at: nil, decidim_user_id: act_as.id)) + resources.published.or( + resources.joins(:coauthorships).where( + published_at: nil, + coauthorships: { decidim_author_id: act_as.id } + ) + ) end end