-
-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix initialization when the Load Rails option is specified #197
Fix initialization when the Load Rails option is specified #197
Conversation
load_rails | ||
else | ||
initialize_options | ||
initialize_logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to use gems like SettingsLogic
@yujideveloper how would that let people to use --rails
and load settings without using SettingsLogic
or similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ERB can't be processed if using something from the Rails project, eg.
queues:
- [<%= Rails.application.config.some_setting %>, 1]
- [<%= Settings.some_other_setting %>, 1]
because options are initialised before the Rails environment is loaded. That config file results in an uninitialized constant
error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for slow response.
What I want to say is same as this comment.
I think you are right, we have to load rails upfront. This functionality was somehow broken in last release. |
I think approach is good, but let's add some clarity to the codeflow. load_rails if options[:rails]
initialize_options
initialize_logger
... |
654536c
to
2e7833a
Compare
@mariokostelac @phstc |
I've checked manually against the codebase that was not able to have shoryuken upgraded because of loading config before rails and I am happy to say it does work! |
I want to use gems like SettingsLogic with Rails environements in the Shoryuken configuration file.
So, Rails must be loaded before loading the Shoryuken configuration file.