aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-03-09 21:57:57 +0900
committerGitHub <noreply@github.com>2019-03-09 21:57:57 +0900
commit35efe44f5379b031e6d4abab7b0a8c280e31b640 (patch)
tree8be2eb1d4381bd2f50ec866238f950cbeeb357f9
parent176070f0baf28c65333cda9a6dd8c045643ea5bb (diff)
parent8049fa19fb0c0a390061ca9420d4495efd24249b (diff)
downloadrails-35efe44f5379b031e6d4abab7b0a8c280e31b640.tar.gz
rails-35efe44f5379b031e6d4abab7b0a8c280e31b640.tar.bz2
rails-35efe44f5379b031e6d4abab7b0a8c280e31b640.zip
Merge pull request #35553 from sharang-d/update-upsert_all-doc
Update upsert_all documentation [ci skip]
-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