seamusabshere/upsert — pull request #12 by sungchoi (2012-12-12 03:03:36+00:00)
Title: Ar batch many

Hi Seamus,

I'm a junior dev and it is my first time making a pull request to a open source project.

First, thank you for writing this gem. I am a DevBootCamp summer graduate and we used in our final group project. We were working with significant amounts of data and this gem was a lifesaver. While using it though, I found it inconvenient to write each row out by hand.

I wrote a method for that project that is essentially the ar_batch_many method that I am proposing to add to the gem. I'm sure there is a much better name for the method but I haven't thought of one just yet.

It allows batch to take an array of attribute hashes as an argument and also automatically finds the connection and table name using activerecord, given the model name.

Please let me know what you think.

Lastly, I wanted add tests for this method, but I'm unfamiliar with, I think you're using, TestUnit. So, I apologize that I am not of use in that respect.

Best,
Sung