osem icon indicating copy to clipboard operation
osem copied to clipboard

Refactor LetterOpenerWeb mounting condition

Open chennes opened this issue 4 months ago • 1 comments

Prevent any attempt to access LetterOpenerWeb when running in production.

Checklist

  • [X] I have read the Contribution & Best practices Guide.
  • [X] My branch is up-to-date with the upstream master branch.
  • [X] The tests pass locally with my changes.
  • [ ] I have added tests that prove my fix is effective or that my feature works(if appropriate).
  • [ ] I have added necessary documentation (if appropriate).

Short description of what this resolves/which issues does this fix?:

  • When running in production mode, the original code fails with an error about access to LetterOpenerWeb because of the way Rails runs the existing line. This PR refactors the check to ensure that only the development environment attempts to access it.

Changes proposed in this pull request:

  • Refactor the use of LetterOpenerWeb to check for the dev environment before attempting to access it.

chennes avatar Oct 14 '25 15:10 chennes

The linter is complaining about the block length, which went from 202 to 204 lines -- it's beyond my meager Ruby skills to refactor this code in any sensible way. And of course IMO it doesn't make sense to do so as part of this PR :). At any rate, if that's what's holding this up please let me know, I don't know this project's policy on CI failures.

chennes avatar Nov 06 '25 14:11 chennes