Fix serialization error in resource on component publication#15834
Merged
andreslucena merged 21 commits intodevelopfrom Feb 18, 2026
Merged
Fix serialization error in resource on component publication#15834andreslucena merged 21 commits intodevelopfrom
andreslucena merged 21 commits intodevelopfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an ActiveJob serialization error that occurred when publishing/unpublishing the budgets component. The error was caused by passing an ActiveRecord::Associations::CollectionProxy to ActiveJob, which cannot be serialized. The fix converts the collection to an array using .to_a before passing it to the job.
Key Changes
- Fixed serialization error in budgets component by converting
budget.projectsto an array before passing to search index jobs - Added test coverage across 10 components to ensure publish/unpublish functionality works correctly
- Added shared test context
"when publishes and unpublishes component"to provide reusable test structure
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| decidim-budgets/lib/decidim/budgets/component.rb | Fixed ActiveJob serialization by converting budget.projects to array in publish/unpublish hooks |
| decidim-dev/lib/decidim/dev/test/rspec_support/component_context.rb | Added shared test context for testing component publish/unpublish functionality |
| decidim-accountability/spec/system/admin/admin_publishes_component_spec.rb | Added test for accountability component publish/unpublish |
| decidim-blogs/spec/system/admin_publishes_component_spec.rb | Added test for blogs component publish/unpublish |
| decidim-budgets/spec/system/admin_publishes_component_spec.rb | Added test for budgets component publish/unpublish |
| decidim-collaborative_texts/spec/system/admin/admin_publishes_component_spec.rb | Added test for collaborative_texts component publish/unpublish |
| decidim-debates/spec/system/admin_publishes_component_spec.rb | Added test for debates component publish/unpublish |
| decidim-elections/spec/system/admin/admin_publishes_component_spec.rb | Added test for elections component publish/unpublish |
| decidim-meetings/spec/system/admin/admin_publishes_component_spec.rb | Added test for meetings component publish/unpublish |
| decidim-pages/spec/system/admin_publishes_component_spec.rb | Added test for pages component publish/unpublish |
| decidim-proposals/spec/system/admin/admin_publishes_component_spec.rb | Added test for proposals component publish/unpublish |
| decidim-surveys/spec/system/admin_publishes_component_spec.rb | Added test for surveys component publish/unpublish |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
decidim-meetings/spec/system/admin/admin_publishes_component_spec.rb
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
andreslucena
requested changes
Dec 22, 2025
decidim-accountability/spec/system/admin/admin_publishes_component_spec.rb
Outdated
Show resolved
Hide resolved
decidim-dev/lib/decidim/dev/test/rspec_support/component_context.rb
Outdated
Show resolved
Hide resolved
Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
Contributor
Author
|
@andreslucena seems to be ready again ... |
andreslucena
approved these changes
Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎩 What? Why?
While trying to replicate the fix for #15830 , i came across the following error:
📌 Related Issues
Link your PR to an issue
Testing
📷 Screenshots
Please add screenshots of the changes you are proposing

Summary by CodeRabbit
Tests
Refactor
Behavior