Source Code : 
ActiveRecord::Base.transaction do
    
100.times Model.create(nameSecureRandom.base64(5)) }
end 

[Login or Register to remove this advertisement]

Mobile_Guru Reviewed by Mobile_Guru on . Bulk insert in database ActiveRecord::Base.transaction do 100.times { Model.create(name: SecureRandom.base64(5)) } end Rating: 5