Agile Tortoise
Greg Pierce’s blog
« Sleep Apnea Home again, Home again »
Application-wide preferences in Rails
I’m likely missing something obvious, but I haven’t found the proper “rails” way of handling application-wide preferences. I want to store the prefs in the db, probably in a table something like this:
preferences
id = int(11)
name = varchar
type = varchar [boolean/string/int/float/array/etc]
value = varchar
Then one-time, for the app, load that table, coerce the values as appropriate and expose a single Pref instance to access those values.
Do I put this in environment.rb? That seems like the right place. Any ideas?