I need to store semi-constants :
- Static variables (just one of each per application)
- Used in many places (somewhat as templates)
- Some SuperUsers can edit them (frontend form to edit them)
- Persistence (must keep their value even with a serverrestart)
- Different types (DateTime, String, Float, Integer, etc.)
Is there a nice way to do that ? (We're talking about just ~20 constants)
There is the solution of 1 table with as many columns as constants. Ugly. Our old application used to have a table "Constants" where one constant = one entry. But I think this is ugly as well because they had one "column" per type of constant
(I'm talking about columns as for now my app is using ActiveRecord, but we might change to mongoid later. Yet it would pose the same problem of having one table with just one entry)