title: Import records from CSV in small chunks (ruby on rails)
body: <p>I need to import a large CSV file, broken down to small chunks that will be imported every X hours.</p>
  
  <p>I made the following rake task</p>
  
  <pre><code>task :import_reviews =&gt; :environment do
   require 'csv'
   CSV.foreach('reviews.csv', :headers =&gt; true) do |row|
    Review.create(row.to_hash)
   end
  end
  </code></pre>
  
  <p>Using heroku scheduler I could let this task run every day, but I want to break it up in several chunks, for example 100 records every day:</p>
  
  <p>That means I need to keep track of the last row imported, and start with that row += 1 the next time I would let the rake task run, how can I implement this?</p>
  
  <p>Thanks in advance!</p>