Now Rails 6 have support to bulk insert data using ActiveRecord. You should pass an array of hashes into the insert_all method (like the below example) to insert multiple rows in a single SQL query.

Book.insert_all([
  { id: 1, title: "Rework", author: "David" },
  { id: 2, title: "Eloquent Ruby", author: "Russ" }
])

Also, it will skip duplicate records in the array by default.

# Insert records and skip inserting any duplicates.
# Here "Eloquent Ruby" is skipped because its id is not unique.

Book.insert_all([
  { id: 1, title: "Rework", author: "David" },
  { id: 1, title: "Eloquent Ruby", author: "Russ" }
])

And it is supporting the bang (!) operator too (insert_all!).