[Rails] Re: Loading Seed Data from MySQL exported file

2010-01-18 Thread Aleksey Gureiev
I believe, converting of data to the seed.rb format is not an option? If so, the easiest way would be to write a rake task to use mysql or sqlite3 to upload your data. Here's the sample that I put together quickly: http://gist.github.com/279918 It replaces the standard db:seed with the SQL-based

[Rails] Re: Loading Seed Data from MySQL exported file

2010-01-18 Thread Billee D.
Hi Ahmed, I think you want to create fixtures for your seed data: http://api.rubyonrails.org/classes/Fixtures.html Fixtures can even be scoped to an environment so you can have distinct seed data for Development, Testing and Production. But, recent versions of Rails use something called seed.rb

Re: [Rails] Re: Loading Seed Data from MySQL exported file

2010-01-18 Thread Colin Law
On Jan 18, 2:31 am, Ahmed Abdelsalam li...@ruby-forum.com wrote: Hello, I'm developing an application, and I want to automatically load seed data into database. The seed data exists in a SQL file (exported from MySQL database). I want the application to load such data when I make db:reset

[Rails] Re: Loading Seed Data from MySQL exported file

2010-01-18 Thread Ahmed Abdelsalam
Aleksey Gureiev wrote: I believe, converting of data to the seed.rb format is not an option? If so, the easiest way would be to write a rake task to use mysql or sqlite3 to upload your data. Here's the sample that I put together quickly: http://gist.github.com/279918 It replaces the standard

[Rails] Re: Loading Seed Data from MySQL exported file

2010-01-18 Thread Ahmed Abdelsalam
Billee D. wrote: Hi Ahmed, I think you want to create fixtures for your seed data: http://api.rubyonrails.org/classes/Fixtures.html Fixtures can even be scoped to an environment so you can have distinct seed data for Development, Testing and Production. But, recent versions of Rails use