After uploading a file, I parse it and then I save those records in the database as it shown here:
sheet1.each 1 do |row| @time_record = TimeRecord.create(:employee_id => 2 , :date => DateTime.parse(row)) @time_record.save end
The problem is that in this way I am doing a commit after every insert.
How can I insert everything and then commit?
Thanks for your answers!