osem
osem copied to clipboard
Refactor LetterOpenerWeb mounting condition
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
masterbranch. - [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
LetterOpenerWebbecause 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
LetterOpenerWebto check for the dev environment before attempting to access it.
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.