Skip to content

refactor: inline address formatting in EventCalendar to remove layer violation#2710

Merged
mroderick merged 2 commits into
masterfrom
fix/event-calendar-presenter-violation
Jul 15, 2026
Merged

refactor: inline address formatting in EventCalendar to remove layer violation#2710
mroderick merged 2 commits into
masterfrom
fix/event-calendar-presenter-violation

Conversation

@mroderick

Copy link
Copy Markdown
Collaborator

Problem

Services::EventCalendar in lib/services/ (infrastructure layer) depends on AddressPresenter in app/presenters/ (presentation layer). This breaks the layered architecture rule that lower layers must not depend on higher layers.

Solution

Inline the address formatting directly in the service. The AddressPresenter#to_s method does a simple join of [flat, street, city, postal_code] — no presenter needed.

Verification

  • Behaviour preserved: same field selection, same empty-filtering, same separator
  • Only caller is EventInvitationMailer#attending, which still passes the same event object
  • No test exists for EventCalendar (pre-existing)

Layer analysis context

This was identified by a full layered-architecture audit of the codebase. The audit found no other critical layer violations.

…violation

EventCalendar (infrastructure layer) was using AddressPresenter
(presentation layer) to format venue addresses. Inline the simple
join of address fields directly, matching AddressPresenter#to_s
behaviour without the upward dependency.
@mroderick mroderick marked this pull request as ready for review July 15, 2026 16:28
@mroderick mroderick enabled auto-merge July 15, 2026 19:00
@mroderick mroderick merged commit 56925ac into master Jul 15, 2026
8 checks passed
@mroderick mroderick deleted the fix/event-calendar-presenter-violation branch July 15, 2026 19:02
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