zdennis/activerecord-import — pull request #104 by robmathews (2013-07-03 18:04:14+00:00)
Title: return the ids from a bulk insert [postgres only]

A common request is to return the ids from the newly created object. This patch does that. It's postgres only, but at least it doesn't break for non-postgres databases - it just doesn't set the id.

The api is unchanged. Instead, for every model that was saved, it sets the :id and marks the record clean, so that you can keep using it if you want.

Seems like one could pretty easily do a BFS on the changed associations and bulk-import the next level down in the tree in one sql statement as well .. at least for postgres.

Let me know if this is any use to you; works fine for us, and that's all I need.