Skip to content

refactor: rename InvitationController to WorkshopInvitationController#2530

Merged
olleolleolle merged 1 commit intocodebar:masterfrom
mroderick:workshop-invitation-controller
Mar 18, 2026
Merged

refactor: rename InvitationController to WorkshopInvitationController#2530
olleolleolle merged 1 commit intocodebar:masterfrom
mroderick:workshop-invitation-controller

Conversation

@mroderick
Copy link
Collaborator

@mroderick mroderick commented Mar 18, 2026

Motivation

The original InvitationController and InvitationControllerConcerns had several issues:

  1. Naming confusion: The controller was named InvitationController but actually handles only workshop invitations (WorkshopInvitation model), not event invitations (Invitation model). There was also an admin controller with the same name handling event invitations, causing confusion.

  2. Over-extracted concerns: InvitationControllerConcerns was only used in one place (the controller itself), violating the "3 uses before extracting" guideline. The methods have been inlined directly into the controller.

  3. No documentation: The controller had no comment explaining its purpose or that it handles workshop invitations specifically.

Analysis

  • InvitationControllerConcerns: Used only by InvitationController - inlined into the controller
  • WorkshopInvitationConcerns: Still needed by WaitingListsController - kept as a shared concern
  • Admin::InvitationController: Handles different model (Invitation for events) - left unchanged

Summary

  • Inline InvitationControllerConcerns into the controller (deleted unused concern file)
  • Rename InvitationController to WorkshopInvitationController for clarity
  • Add dual routes for backwards compatibility (/invitation/:token and /workshop_invitation/:token)
  • Rename views from app/views/invitation/ to app/views/workshop_invitation/
  • Add .worktrees/ to .gitignore

Existing invitation links in emails continue to work via the legacy route.

- Inline InvitationControllerConcerns into the controller
- Rename controller to WorkshopInvitationController for clarity
- Add dual routes for backwards compatibility (/invitation and /workshop_invitation)
- Rename views from app/views/invitation to app/views/workshop_invitation
- Add .worktrees/ to .gitignore
@mroderick mroderick force-pushed the workshop-invitation-controller branch from fd52057 to 5b692c8 Compare March 18, 2026 06:46
Copy link
Collaborator

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the excellent context in the PR, merging!

@olleolleolle olleolleolle merged commit 785bebb into codebar:master Mar 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants