Add comments to EventRegistration form#1115
Merged
Conversation
Set up polymorphic comments on EventRegistration following the same pattern used by Person, User, and Organization. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- EventRegistrationsController#update: use assign_attributes + save pattern to set created_by/updated_by on comments (matching people, users, organizations controllers) - EventRegistrationsController: eager-load comments with created_by and updated_by associations - CommentsController#create: set created_by on standalone comment creation for all commentable models - Comment fields partial: update color palette and fallback to "Unknown" for comments without created_by Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Explicitly set both created_by and updated_by when creating new comments, whether via CommentsController#create or nested attributes in all four commentable controllers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
maebeale
commented
Feb 20, 2026
| authorize! | ||
| @comment = @commentable.comments.build(comment_params) | ||
| @comment.created_by = current_user | ||
| @comment.updated_by = current_user |
Collaborator
Author
There was a problem hiding this comment.
making these explicitly saved
maebeale
commented
Feb 20, 2026
| authorize! @organization | ||
| @organization.assign_attributes(organization_params) | ||
| @organization.comments.select(&:new_record?).each { |c| c.created_by = current_user } | ||
| @organization.comments.select(&:new_record?).each { |c| c.created_by = current_user; c.updated_by = current_user } |
Collaborator
Author
There was a problem hiding this comment.
adding updated_by on create
maebeale
commented
Feb 20, 2026
|
|
||
| @person.assign_attributes(person_params) | ||
| @person.comments.select(&:new_record?).each { |c| c.created_by = current_user } | ||
| @person.comments.select(&:new_record?).each { |c| c.created_by = current_user; c.updated_by = current_user } |
Collaborator
Author
There was a problem hiding this comment.
adding updated_by on create
maebeale
commented
Feb 20, 2026
| @user.assign_attributes(user_params.except(:password, :password_confirmation)) | ||
| @user.updated_by = current_user | ||
| @user.comments.select(&:new_record?).each { |c| c.created_by = current_user } | ||
| @user.comments.select(&:new_record?).each { |c| c.created_by = current_user; c.updated_by = current_user } |
Collaborator
Author
There was a problem hiding this comment.
adding updated_by on create
maebeale
commented
Feb 20, 2026
| ["bg-yellow-200", "text-yellow-800"], | ||
| ["bg-red-100", "text-red-800"] | ||
| ["bg-blue-100", "text-blue-800"], | ||
| ["bg-green-100", "text-green-800"], |
Collaborator
Author
There was a problem hiding this comment.
changing which colors get used to show updated by initials
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.
Set up polymorphic comments on EventRegistration following the same pattern used by Person, User, and Organization.
What is the goal of this PR and why is this important?
How did you approach the change?
Anything else to add?