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

ActiveRecord support #28

Closed
treydock opened this issue Mar 9, 2012 · 1 comment
Closed

ActiveRecord support #28

treydock opened this issue Mar 9, 2012 · 1 comment
Milestone

Comments

@treydock
Copy link

treydock commented Mar 9, 2012

I'd like to utilize the power of rails_config to extend the storage of the key / value pairs in ActiveRecord databases. Is this possible with the existing code? Maybe if someone points me in the direction of where to add this functionality I may be able to extend this gem further with ActiveRecord support.

If I was to create a model with the same name of Settings, is it possible to default to ActiveRecord with the YAML files as fallback?

@timuckun
Copy link

timuckun commented Feb 5, 2013

One possible approach would be to create a table which contains two fields :name and :value the value field would be serialized.

This way you can theoretically load and merge the settings from the database just like you would from any yaml file but you could also write them back to the database.

The Settings class would have to keep track of which values came from where and write them only if they came from the database.

Another would be to use a hyrbrid approach fat_free_crm does this. Take a look at their settings model.

@pkuczynski pkuczynski added this to the 0.3.pre milestone Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants