I'd like to create a Settings model centered around a "settings" database table in my Ruby app. The table looks like this:
==========================
id | key | value
==========================
1 | site_version | 1.0.5
2 | something | value
I'd like to be able to access each row in this table via this Settings model just like I would a normal Ruby hash. So I could use Settings.site_version or Settings['site_version'] to access the "site_version" value.
I know I've seen something like this before, but I'm not seeing anything out there. How would I achieve this? A link to a blog article would also suffice.