Fix: move sms config to jh initializers fold
Related to !662 (merged)
What does this MR do and why?
This does not happen on production.
The jh/lib/jh/sms.rb
is included in Rails autoload list and will be reloaded in development mode according to Rails autoloading doc, then the JH::Sms.config used in views will be reset to nil.
Rails.application.config.autoload_paths.grep /jh\/lib/
=> ["/Users/mtan/dev/jihu-gitlab/gitlab/jh/lib", "/Users/mtan/dev/jihu-gitlab/gitlab/jh/lib/generators"]
To fix this we need to:
-
Move the jh/lib/jh/sms.rb
to initializers fold to avoid the file reloading.
Screenshots or screen recordings
How to set up and validate locally
- Goto
{{YOUR_HOST}}/users/sign_up
- You should see the phone area code drop list
- Add a comment to a random file under /jh/lib/
- Reload your browser
- Then you should see this error
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
由 Martin Tan 编辑于