Added :synchronize_keys to the import options so importing can synchronize on fields beside the primary key.

https://github.com/zdennis/activerecord-import/issues/16
This commit is contained in:
Zach Dennis 2011-04-06 14:20:53 -04:00
parent e00e9d7d59
commit 7958ed18c2
3 changed files with 43 additions and 10 deletions

View file

@ -212,7 +212,8 @@ class ActiveRecord::Base
end
if options[:synchronize]
synchronize( options[:synchronize] )
sync_keys = options[:synchronize_keys] || [self.primary_key]
synchronize( options[:synchronize], sync_keys)
end
return_obj.num_inserts = 0 if return_obj.num_inserts.nil?