From 0ede7d550aadc6156740500d00994730d108e101 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Tue, 14 Oct 2025 10:32:41 -0500 Subject: [PATCH] Refactor LetterOpenerWeb mounting condition Prevent any attempt to access `LetterOpenerWeb` when running in production. --- config/routes.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 730d43cf..70b850b7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,8 @@ Osem::Application.routes.draw do - mount LetterOpenerWeb::Engine, at: '/letter_opener' if Rails.env.development? - + if Rails.env.development? && defined?(LetterOpenerWeb) + mount LetterOpenerWeb::Engine, at: '/letter_opener' + end + constraints DomainConstraint do get '/', to: 'conferences#show' end