Grary wrote: > So, I think that my data should be accessible by administrators, but > what is the Rails mechanism for that access? Am I going to be issuing > raw SQL commands?
Essentially, anything that can be stored in a database table can be modeled. From what I understand from your original post, you have a set of values that could possibly be changed, but not often. Let's make sure I understand your requirements: - You need to store a list of values that are to be used in in calculations. - There is a fixed number of different parameters. Let's call them (x, y & z). - The parameters x, y & z will be initialized to known values. - The values of x, y & z are normally fixed, but can be altered by users (administrators) at runtime. Here are some options: 1. Use a configuration file to store key/value pairs. 2. Use a database with a single row containing the values in the columns of the table. +----+------+------+-------+ | id | x | y | z | +----+------+------+-------+ | 1 | 10.0 | 12.5 | 0.124 | +----+------+------+-------+ 3. Use a database table with multiple rows to simulate a key/value store. +----+-------+-------+ | id | key | value | +----+-------+-------+ | 1 | x | 10.0 | | 2 | y | 12.5 | | 3 | z | 0.124 | +----+-------+-------+ The advantage here is that the number of parameters the is not fixed. No need to add a new column to add a new key/value. 4. Use an actual key/value persistent store (http://code.google.com/p/redis/). This is very probably overkill for your situation. In all of these cases you could use seeds.rb to initialize your values. >From what I can glean I'd most likely go with option 1. Use a configuration file (YAML). If the administrator needs to change the configuration then just update the file with the new parameter. You will also like want to cache these values in some form of memory cache so you don't have to read the values from disk/database on every request. Take a look at memcached. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

