This a rake script by technoweenie I believe, I modified it to stip out
schema.rb importing.
namespace :db do
desc "Loads the initial database fixtures."
task :bootstrap => [''db:bootstrap:load'']
namespace :bootstrap do
desc "Load initial database fixtures (in db/bootstrap/*.{yml,cvs})
into the current environment''s database. Load specific fixtures using
FIXTURES=x,y"
task :load => :environment do
require ''active_record/fixtures''
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
(ENV[''FIXTURES''] ?
ENV[''FIXTURES''].split(/,/) : Dir.glob(
File.join(RAILS_ROOT, ''db'', ''bootstrap'',
''*.{yml,csv}''))).each do
|fixture_file|
Fixtures.create_fixtures(''db/bootstrap'',
File.basename(fixture_file,
''.*''))
end
end
end
end
Stick it in lib/tasks/bootstrap.rake
then each time you do rake db:migrate
run rake db:bootstrap too
On 04/09/06, Beate Paland
<bpaland-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
>
> Hi,
>
> I just found a patch about importing a csv file in a migration:
> http://dev.rubyonrails.org/ticket/5293
> This feature would be great, but the patch seems to sleep :(
> Perhaps anyone could attend to this patch?
>
> Thanks,
> Beate
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---