Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (10 sloc) 364 Bytes

MysqlMultiInsert

Insert multiple AR objects with one SQL INSERT statement.

Example

class MyClass < ActiveRecord::Base
  include MysqlMultiInsert
end

obj1 = MyClass.new
obj2 = MyClass.new

MyClass.multi_insert [obj1, obj2] #=> One insert statement

Copyright © 2009 Scott Taylor <scott@railsnewbie.com>, released under the MIT license