title: Rails transaction not rolling back
body: <p>Why wouldn't this transaction rollback if even one create! fails?
  It's in a controller if that makes any difference.</p>
  
  <pre><code>def process_photos(photos)
    ActiveRecord::Base.transaction do
      begin
        photos.each do |photo|
          Photo.create!(creator_user: @user, buyer: @buyer, url: photo['url'])
        end
      rescue
        raise ActiveRecord::Rollback
      end
    end
  end
  </code></pre>
  
  <p>I'm explicitly sending an array with some bad records. The good ones are getting created and the bad ones aren't but I need the whole thing to rollback if even one fails.</p>
  
  <p>Here's my rspec test (passing a json array of photos) and it's incrementing.</p>
  
  <pre><code>expect { post :create, json }.not_to change(Photo, :count)
  </code></pre>