Skip to content

Commit 6f1208d

Browse files
committed
Fix returning docs for upsert_all [ci skip]
`upsert_all` is used to try to INSERT rows in a table, falling back to an UPDATE operation for the rows that would be duplicate. The result of `upsert_all` (driven by `returning_by`) includes both the rows that were inserted and the rows that were updated, but the documentation was not super clear about this: > An array of attributes to return for all successfully inserted records [ci-skip]
1 parent d48a356 commit 6f1208d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/relation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ def upsert(attributes, **kwargs)
820820
#
821821
# [:returning]
822822
# (PostgreSQL, SQLite3, and MariaDB only) An array of attributes to return for all successfully
823-
# inserted records, which by default is the primary key.
823+
# upserted records, which by default is the primary key.
824824
# Pass <tt>returning: %w[ id name ]</tt> for both id and name
825825
# or <tt>returning: false</tt> to omit the underlying <tt>RETURNING</tt> SQL
826826
# clause entirely.

0 commit comments

Comments
 (0)