zdennis/activerecord-import — Issue #41: hash instead of arrays for 'fastest' mode?
Author: jrochkind
Created: 2012-01-17 23:21:31+00:00
State: open

Already supported:

columns = [ :title, :author ]
values = [ ['Book1', 'FooManChu'], ['Book2', 'Bob Jones'] ]

# Importing without model validations
Book.import columns, values, :validate => false

Would it make sense to support a basic array import too, which would presumably be nearly as fast (no AR models), but in some cases easier to read/write?

hashes = []
hashes << {:title => 'Book1', :author => 'FooManChu'}
hashes << {:title => 'Book2', :author => 'Bob Jones'}

Book.import hashes, :validate => false

?