Skip to content
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

Make yettings load before initializers? #7

Open
dpehrson opened this issue Apr 22, 2012 · 1 comment
Open

Make yettings load before initializers? #7

dpehrson opened this issue Apr 22, 2012 · 1 comment

Comments

@dpehrson
Copy link

Is it possible to make yettings load before initializers so that their values may be used in there?

I attempted to fork the repo and change the config.before_configuration to config.before_initialize but it didn't work, which may very well just be because I am not familiar with Railties.

Is this something that would be doable?

My use case is that I want to put the api keys used by devise's devise.rb initializer into a yettings.yml.

@AdamFerguson
Copy link
Member

If you're still working off a forked version, instead of doing the config.before_configuration, you can do something like:

initializer "whatevever_you_want_to_call_your_initializer", :before => "name_of_the_initializer_where_you_want_to_use_yettings" do
  Yettings.setup!
end

Off the top of my head, I can't think of a good way of adding this into the gem in a reusable way, definitely worth thinking about though. Would be a good feature. You can check out this blogpost for more info on the rails initialization process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants