Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (10 sloc) 0.364 kb

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

Jump to Line
Something went wrong with that request. Please try again.