I'm trying to use activerecord-import as a way to import multiple records.
I'm trying to run
Field.import records, :on_duplicate_key_update => [:application_id,:key]
where records is an array of Field records.
The error I'm getting is:
NoMethodError: undefined method 'add_column_for_on_duplicate_key_update' for # from /GEMS/gems/activerecord-import-1.0.4/lib/activerecord-import/import.rb:1003:in 'block in add_special_rails_stamps'
I've also tried running Field.import records and Field.import records, on_duplicate_key_update: [:application_id, :key] but both of them give the same error.
I've had a good search but I can't find anything of use anywhere else.
If You are Using Rails 6 then you can use:
If not then try to use following syntax: