create 1000 items in DB


I want to create 1000 items at once(vouchers) in my db. My class name is Voucher. How can ik realize this...?


Hey Remco,

What format is your input data in? Will this happen regularly or is this a one-time insert?

It sounds like you might want to look at ActiveRecord Extensions:

Regards, Gustav Paul

and there is always the obvious solution:

1000.times do   Voucher.create(:attribute1 => 'value1') end