Fix missing partial when editing comments with @mentions#2828
Merged
flavorjones merged 1 commit intomainfrom Apr 9, 2026
Merged
Fix missing partial when editing comments with @mentions#2828flavorjones merged 1 commit intomainfrom
flavorjones merged 1 commit intomainfrom
Conversation
Edge Rails introduced ActionText::Attachable#to_editor_content_attachment_partial_path
which defaults to to_partial_path ("users/user"). Override it in User::Mentionable to
delegate to to_attachable_partial_path ("users/attachable"), matching the existing
display rendering path.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a regression introduced by the Edge Rails editor adapter system when rendering @mention attachments inside the comment editor: Rails now calls to_editor_content_attachment_partial_path, which previously defaulted to a non-existent users/_user partial for User mentions.
Changes:
- Override
User#to_editor_content_attachment_partial_path(viaUser::Mentionable) to use the existingusers/attachablerendering path. - Add a controller regression test covering editing a comment that contains an
@mentionattachment.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
app/models/user/mentionable.rb |
Adds an explicit editor-attachment partial path override to prevent missing-partial errors during comment editing. |
test/controllers/cards/comments_controller_test.rb |
Adds regression coverage asserting mention attachments render correctly in the editor’s initial value. |
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
ActionText::Attachable#to_editor_content_attachment_partial_pathwhich defaults toto_partial_path("users/user"). When editing a comment containing @mentions, the new editor adapter system calls this method to render mention content inside the rich text editor. Sinceusers/_user.html.erbdoesn't exist, this raisesActionView::Template::Error.to_editor_content_attachment_partial_pathinUser::Mentionableto delegate toto_attachable_partial_path("users/attachable"), matching the existing display rendering path.The Rails change was introduced as part of the edge Rails bump in #2820 (Lexxy 0.9.5.beta), which incidentally upgraded Rails from
12e24eafto75f9e28379ac. The newto_editor_content_attachment_partial_pathmethod was added as part of the editor adapter system. See the upgrade analysis for full details on changes in this Rails bump.Test plan
Missing partial users/_user)