You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Settings const name is not available right after Config.setup #187
I am trying to access Settings const name in config.rb right after Config.setup, but getting an error?
*/initializers/config.rb
Config.setupdo |config|
config.const_name='Settings'end# Following results in an error - uninitialized constant Settings (NameError)Settings.add_source!("#{Rails.root}/config/tune.yml")Settings.reload!
Reacted by Peter Duijnstee, Andy Allan and Michael Franzl
Since this is 1.5 years old I'm assuming this is probably resolved by now, but FWIW @kapso, you could create a separate initializer to load the tune.yml sources. I think something like this should work:
Activity
pkuczynski commentedon Aug 6, 2019
This is not a valid way of doing, what you try to do.
add_sourceshould be called outside of initializer...If your case is still needed we could add an option
extra_sourcesto add additional sources. But in general idea behind this gem was to stick with following pattern: https://github.com/railsconfig/config/blob/master/lib/config.rb#L58supremebeing7 commentedon Aug 7, 2019
Since this is 1.5 years old I'm assuming this is probably resolved by now, but FWIW @kapso, you could create a separate initializer to load the
tune.ymlsources. I think something like this should work:*/initializers/config.rb
*/initializers/tune.rb
pkuczynski commentedon Aug 7, 2019
Yes, that could be a workaround for now. Closing this until further interest from anybody...