Slide 73
Slide 73 text
#saintprubyconf @ssnickolay
RAILS 6.0: BULK INSERTS
# Insert multiple records, performing an upsert
# when records have duplicate ISBNs
Book.upsert_all([
{ title: 'Rework', author: 'David', isbn: '1' },
{ title: 'Eloquent Ruby', author: 'Russ', isbn: '1' }
],
unique_by: { columns: %w[ isbn ] })
*gem ‘activerecord-import`