refactor: move WorkshopCalendar from models to serializers layer#2698
Merged
Conversation
WorkshopCalendar is a serialization class that builds iCalendar output from a workshop model. It has no domain identity, no persistence, and no business invariants. Place it in the correct architectural layer. Rails 8 autoloads all app/ subdirectories, so no require path updates are needed.
The existing tests verified calendar event structure through the internal .calendar accessor. Add tests for the public #ical method (the actual interface used by mailers) that assert on the raw iCalendar output format and verify the invitation URL appears in the event description. Also add an explicit setup test that confirms #setup runs during initialization, making that side effect visible.
KimberleyCook
approved these changes
Jul 10, 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
Move
WorkshopCalendarfromapp/models/(domain layer) toapp/serializers/(infrastructure layer), where serializers belong in layered architecture.Why
As identified in the layered-architecture analysis,
WorkshopCalendaris a pure serialization class — it builds iCalendar output from a workshop model using theicalendargem. It has no domain identity, no persistence, and no business invariants. Two mailers already use it asWorkshopCalendar.new(...).ical, which is a serializer call pattern.Changes
Commit 1 —
b67db371— Pure rename, zero code changes:app/models/workshop_calendar.rb→app/serializers/workshop_calendar.rbspec/models/workshop_calendar_spec.rb→spec/serializers/workshop_calendar_spec.rbRails 8 autoloads all
app/subdirectories, so no require path updates needed. Both mailers resolve the class automatically.Commit 2 —
4c4146af— Strengthen test coverage:#icalmethod, but tests only checked the internal.calendaraccessor. Added tests for#icalasserting on raw iCalendar output format.Verification