aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorSharang Dashputre <sharang.d@gmail.com>2019-03-09 18:09:14 +0530
committerSharang Dashputre <sharang.d@gmail.com>2019-03-09 18:23:43 +0530
commit8049fa19fb0c0a390061ca9420d4495efd24249b (patch)
tree8be2eb1d4381bd2f50ec866238f950cbeeb357f9 /activerecord
parent176070f0baf28c65333cda9a6dd8c045643ea5bb (diff)
downloadrails-8049fa19fb0c0a390061ca9420d4495efd24249b.tar.gz
rails-8049fa19fb0c0a390061ca9420d4495efd24249b.tar.bz2
rails-8049fa19fb0c0a390061ca9420d4495efd24249b.zip
Update upsert_all documentation [ci skip]
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/persistence.rb5
1 files 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 <tt>books.isbn</tt> 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