Bulk insert in database


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ActiveRecord::Base.transaction do
  2. 100.times { Model.create(name: SecureRandom.base64(5)) }
  3. end

Report this snippet


Comments


You need to login to view comments.