Grary wrote:
> Hi,
> 
> In my Rails app, I have some parameters whose values change only
> infrequently. These parameters are used in computations. Where is the
> place for data like this -- data that is particular to the
> application?
> 
> On the one hand, I might think a flat file (yaml) is appropriate, but
> maybe I shouldn't sacrifice the benefit of modeling my parameters as
> seed data in the seed.rb file.

I use seed data in basically two ways:

1. As a starting point for the production database.

This provides a mean to pre-plan the starting point for the production 
database. This might include things like setting up an admin user, user 
roles, collections for pull-down lists, etc.

2. For populating development data.

This provides a convenient way to reset my development database to match 
the data where my production environment will start.

I would not, however, use seed data in the way you're describing. 
Instead I would use either a static configuration file or use the 
database. For data that I would never want the users to be able to 
change I would use a configuration file (a sort of property list). For 
data that could possibly be altered by the users, or administrators, I 
would use the database to store the values.

Think of seed data as a means of "bootstrapping" your database. You 
would likely only ever run the seed data script once on the production 
database, but possibly many times on the development database.
-- 
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.

Reply via email to