Updating documentation for synchronizing unsaved/new instances with import.

https://github.com/zdennis/activerecord-import/issues/16
master
Zach Dennis 2011-04-06 14:23:13 -04:00
parent 7958ed18c2
commit 58b144b6bf
1 changed files with 5 additions and 0 deletions

View File

@ -129,6 +129,11 @@ class ActiveRecord::Base
# BlogPost.import posts, :synchronize=>[ post ]
# puts post.author_name # => 'yoda'
#
# # Example synchronizing unsaved/new instances in memory by using a uniqued imported field
# posts = [BlogPost.new(:title => "Foo"), BlogPost.new(:title => "Bar")]
# BlogPost.import posts, :synchronize => posts
# puts posts.first.new_record? # => false
#
# == On Duplicate Key Update (MySQL only)
#
# The :on_duplicate_key_update option can be either an Array or a Hash.