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:
parent
e00e9d7d59
commit
7958ed18c2
3 changed files with 43 additions and 10 deletions
|
@ -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?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue