From f61eabda19edb03c9580d90f750de151641e4a68 Mon Sep 17 00:00:00 2001 From: Zach Dennis Date: Sat, 21 Aug 2010 12:44:48 -0400 Subject: [PATCH] Updating README to point to wiki --- README.markdown | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/README.markdown b/README.markdown index 8b8292e..29d7953 100644 --- a/README.markdown +++ b/README.markdown @@ -1,29 +1,8 @@ # activerecord-import -activerecord-import is a library for bulk inserting data using ActiveRecord. By default with ActiveRecord, in order to insert multiple records you have to perform individual save operations on each model, like so: +activerecord-import is a library for bulk inserting data using ActiveRecord. - 10.times do |i| - Book.create! :name => "book #{i}" - end - -This may work fine if all you have is 10 records, but if you have hundreds, thousands, or millions of records it can turn into a nightmare. This is where activerecord-import comes into play. Here's the equivalent behaviour using the #import method: - - books = [] - 10.times{ |i| books << Book.new(:name => "book #{i}") } - Book.import books - -Pretty slick, eh? - -Maybe, just maybe you're thinking, why do I have do instantiate ActiveRecord objects? Will that perform validations? What if I don't want validations? What if I want to take advantage of features like MySQL's on duplicate key update? Well, activerecord-import handles all of these cases and more! - -For more documentation on the matter you can refer to two places: - -1. activerecord-import github wiki: http://wiki.github.com/zdennis/activerecord-import/ -1. the tests in the code base - -# Upgrading from ar-extensions - -This library replaces the ar-extensions library and is compatible with Rails 3. It provides the exact same API for importing data, but it does not include any additional ar-extensions functionality. +For more information on activerecord-import please see its wiki: http://wiki.github.com/zdennis/activerecord-import/ # License