From 8049fa19fb0c0a390061ca9420d4495efd24249b Mon Sep 17 00:00:00 2001 From: Sharang Dashputre Date: Sat, 9 Mar 2019 18:09:14 +0530 Subject: Update upsert_all documentation [ci skip] --- activerecord/lib/active_record/persistence.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index 29d727477d..0c31f0f57e 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -243,7 +243,7 @@ module ActiveRecord # # ==== Examples # - # # Given a Unique Index on books.isbn and the following record: + # # Given a unique index on books.isbn and the following record: # Book.create!(title: 'Rework', author: 'David', isbn: '1') # # # Insert multiple records, allowing new records with the same ISBN @@ -252,8 +252,7 @@ module ActiveRecord # Book.upsert_all([ # { title: 'Eloquent Ruby', author: 'Russ', isbn: '1' }, # { title: 'Clean Code', author: 'Robert', isbn: '2' } - # ], - # unique_by: { columns: %w[ isbn ] }) + # ], unique_by: { columns: %w[ isbn ] }) # def upsert_all(attributes, returning: nil, unique_by: nil) InsertAll.new(self, attributes, on_duplicate: :update, returning: returning, unique_by: unique_by).execute -- cgit v1.2.3