Forum: Ruby on Rails importing data

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F48118fe74b0c7f6fd82a0ee422fa34e?d=identicon&s=25 snacktime (Guest)
on 2005-11-12 12:50
(Received via mailing list)
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
3dd4b52a0946bd698b1d1635a46ea3a3?d=identicon&s=25 francois.beausoleil (Guest)
on 2005-11-12 12:50
(Received via mailing list)
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
F48118fe74b0c7f6fd82a0ee422fa34e?d=identicon&s=25 snacktime (Guest)
on 2005-11-12 21:34
(Received via mailing list)
On 11/11/05, Francois Beausoleil <francois.beausoleil@gmail.com> wrote:
>
> 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
This topic is locked and can not be replied to.