Skip to content

Commit 0ede7d5

Browse files
authored
Refactor LetterOpenerWeb mounting condition
Prevent any attempt to access `LetterOpenerWeb` when running in production.
1 parent 688a8e3 commit 0ede7d5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

config/routes.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Osem::Application.routes.draw do
2-
mount LetterOpenerWeb::Engine, at: '/letter_opener' if Rails.env.development?
3-
2+
if Rails.env.development? && defined?(LetterOpenerWeb)
3+
mount LetterOpenerWeb::Engine, at: '/letter_opener'
4+
end
5+
46
constraints DomainConstraint do
57
get '/', to: 'conferences#show'
68
end

0 commit comments

Comments
 (0)