Active Record Batch Import

47 views
Skip to first unread message

PJ Davis

unread,
Feb 17, 2011, 9:40:31 PM2/17/11
to hsv.rb
I have a case where i have to import a couple of thousand records with
associations into a Rails app, and this is painfully slow. There is a
gem called activerecord-import that seems like it would work, but
doesn't appear to support associations. Does anybody know of a gem or
plugin that could help with this?

Jeremy McAnally

unread,
Feb 17, 2011, 10:05:47 PM2/17/11
to hs...@googlegroups.com
Import from like a CSV?

-j

> --
> You received this message because you are subscribed to the Google Groups "hsv.rb" group.
> To post to this group, send email to hs...@googlegroups.com.
> To unsubscribe from this group, send email to hsvrb+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/hsvrb?hl=en.
>
>

--
http://jeremymcanally.com/ - http://intridea.com/
Bowties, ties, and more: http://wickhamhousebrand.com

My books:
http://r3uh.com http://rbip.info/ http://hlrb.org (FREE!)

Bryan Powell

unread,
Feb 17, 2011, 10:20:48 PM2/17/11
to hs...@googlegroups.com
In my experience it's best not to import large amounts of data with AR if you're concerned about speed. Of course it presents problems if you need to run validations, add associated data, etc. Seems like you have to give something up, just a matter of what.

Bryan
Reply all
Reply to author
Forward
0 new messages