-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Extra config sources defined in initializer #124
Comments
Settings constant is a singleton shared across all request to your Rails app. That means it would load your client config once when the server starts (single Rails server instance serving single client). Is this what you are trying to achieve? In contrast you might want to apply custom client settings per every request, so one server can respond to multiple clients... |
@pkuczynski it would be nice improvement in terms of splitting different config files by domains/technologies. Big config file is difficult for reading/understanding, is there a chance for implementing this feature? |
@IlyaKorol you can add sources in runtime. It should not be hard to do the same on the initializer level as @DannyBen suggested:
Feel free to create PR for this feature and we will merge it. |
This is an interesting idea! Not saying this PR should do it, but I'm wondering if we can extend this to also include non-file-based sources as well. For example, in our app we have a custom source type that points to a database table, so we can store user-driven changes to the settings. It would be cool to be able to inject that in as well by just passing the object to extra_sources. |
Hi,
Not sure if this is implemented and I haven't found it or not.
I know there is a way to create an initializer that adds another settings file and reloads.
Although this is a good feature that can solve my use case of loading config file per client, it feels a little "after the fact patch" since I dont really need it to be "at run time".
I was wondering if it will be difficult to add a more natural way of adding settings file at initialization time, simply as an option to the initializer, something like:
As a side note - where is the documentation of all the allowed options in the
Config.setup
block?The text was updated successfully, but these errors were encountered: