title: Does ActiveRecord perform inserts/deletes in bulk when inside a transaction?
body: <p>What I need:</p>
  
  <ol>
  <li>ensuring atomic updates (no record can gets processed 2 times)</li>
  <li>bulk deletion for all 1000 rows selected</li>
  </ol>
  
  <hr>
  
  <pre><code>@queue = Queue.where("col = 1").limit(1000)
  ids = []
  @queue.each do |row|
      Queue.do_something(row)
      ids &lt;&lt; row.id
  end
  
  Queue.delete_all("id in (#{ids.join(',')}) ")
  </code></pre>
  
  <p>IS THE SAME AS</p>
  
  <pre><code>Queue.transaction do
      @queue.each do |row|
          Queue.do_something(row)
          Queue.delete(row.id)
      end
  end
  </code></pre>