I have an application that needs to have some tables initially populated, such as users, roles, and basic configuration data. The best thing I can think of is to just use put together a script that uses activerecord to load the data. Is there a better way? Chris _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Hi ! 2005/11/11, snacktime <snacktime@gmail.com>:> I have an application that needs to have some tables initially populated, > such as users, roles, and basic configuration data. The best thing I can > think of is to just use put together a script that uses activerecord to load > the data. Is there a better way?Migrations ? With migrations, you can do anything, including using ActiveRecord instances to populate data. I often do that myself, as well as use it to clean up records. Hope that helps ! François _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On 11/11/05, Francois Beausoleil <francois.beausoleil-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi ! > > 2005/11/11, snacktime <snacktime-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > I have an application that needs to have some tables initially > populated, > > such as users, roles, and basic configuration data. The best thing I can > > think of is to just use put together a script that uses activerecord to > load > > the data. Is there a better way? > > Migrations ? With migrations, you can do anything, including using > ActiveRecord instances to populate data. I often do that myself, as > well as use it to clean up records. > > Hope that helps ! > François > >Yes migrations looks like a good place to add initial data and anything else that might need to be added for upgrades. Thanks for the pointer. Chris _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails