Skip to content

refactor: remove dead full_url_for helper and all call sites - #2769

Merged
olleolleolle merged 1 commit into
masterfrom
fix/remove-full-url-for
Jul 31, 2026
Merged

refactor: remove dead full_url_for helper and all call sites#2769
olleolleolle merged 1 commit into
masterfrom
fix/remove-full-url-for

Conversation

@mroderick

@mroderick mroderick commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

full_url_for was dead code. The method concatenated #{@host}#{path}, but @host was never set in any mailer. All callers already passed *_url helpers (invitation_url, event_invitation_url, unsubscribe_url, etc.) which return fully-qualified URLs via config.action_mailer.default_url_options.

History

full_url_for was introduced in October 2013 (6fb19ab5) alongside the first invitation emails, with the apparent intent to prepend a host to relative paths. However, @host was never assigned in any mailer method across the entire project history — it has been dead code from day one.

Rails' *_url helpers (e.g., invitation_url, unsubscribe_url) have always been the actual mechanism for generating URLs in emails, and they produce fully-qualified URLs because config.action_mailer.default_url_options is configured in all environments (localhost:3000 in dev/test, codebar.io in production).

Changes

  • Delete app/helpers/email_helper.rb — the module is now empty
  • Remove include EmailHelper / helper EmailHelper from:
    • VirtualWorkshopInvitationMailer
    • WorkshopInvitationMailer
    • ContactMailer
  • Remove inline helper do blocks defining full_url_for from:
    • FeedbackRequestMailer
    • EventInvitationMailer
    • MeetingInvitationMailer
  • Replace full_url_for(...) with ... in all 21 mailer view call sites across 14 template files

Verification

All 75 mailer specs pass. Controller, feature, and policy specs also verified.

@mroderick
mroderick force-pushed the fix/remove-full-url-for branch from b96d944 to f466a4f Compare July 31, 2026 09:58
@mroderick
mroderick marked this pull request as ready for review July 31, 2026 09:59

@olleolleolle olleolleolle left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good find! 🧹

@olleolleolle
olleolleolle merged commit 7787bf7 into master Jul 31, 2026
10 checks passed
@olleolleolle
olleolleolle deleted the fix/remove-full-url-for branch July 31, 2026 11:46
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