Fix can_participate? into ParticipatoryProcessStep#16008
Fix can_participate? into ParticipatoryProcessStep#16008andreslucena merged 5 commits intodevelopfrom
Conversation
📝 WalkthroughWalkthroughAdded a delegation in Decidim::ParticipatoryProcessStep to forward Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This pull request fixes a missing can_participate? method in ParticipatoryProcessStep that caused errors when viewing notifications after a step activation. The fix delegates the method to the parent participatory_process, following the established pattern used by other child models like Component and Attachment. The PR also adds comprehensive test coverage for both the step activation notification flow and the attachment notification flow (related to PR #15950).
Changes:
- Added delegation of
can_participate?fromParticipatoryProcessStepto its parentparticipatory_process - Added system test for step activation notifications to ensure the fix works correctly
- Refactored and enhanced attachment tests to validate that attachment notifications display properly (coverage for PR #15950)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
decidim-participatory_processes/app/models/decidim/participatory_process_step.rb |
Adds delegate :can_participate?, to: :participatory_process to fix notification rendering errors |
decidim-participatory_processes/spec/system/participatory_process_steps_spec.rb |
Adds test case for step activation notification display to verify the fix |
decidim-admin/lib/decidim/admin/test/manage_attachments_examples.rb |
Refactors attachment creation test and adds new test for attachment notifications to verify PR #15950 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This reverts commit 53b6cd6.
andreslucena
left a comment
There was a problem hiding this comment.
Only a quick change clarifying the example
decidim-participatory_processes/spec/system/participatory_process_steps_spec.rb
Outdated
Show resolved
Hide resolved
…ess_steps_spec.rb Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
|
@andreslucena This is ready for another look |
|
Merging with the only failure of qlty coverage (a bug on simplecov/parallel specs/GH retries, as it says that's -15% but that doesn't make much sense) |
🎩 What? Why?
While i was trying to check the issue fixed by #15950 i went to the notifications path and i got served with an error, caused by activation of a new ParticipatoryProcessStep. This Step was activated when i have locally tested #15988
Additionally i am adding a spec for the work done in #15950.
📌 Related Issues
Link your PR to an issue
can_participate?based on it's attached model #15950Testing
To validate the spec, switch to this branch, edit the Attachment work and revert the work done in #15950, then run:
./bin/rspec decidim-participatory_processes/spec/system/admin/admin_manages_participatory_process_attachments_spec.rbYou should see an error similar with the above.
📷 Screenshots
Please add screenshots of the changes you are proposing

Summary by CodeRabbit
New Features
Tests