Merge pull request #49063 from gregmolnar/upsert

This commit is contained in:
Jean Boussier 2023-08-28 19:31:44 +02:00 committed by GitHub
commit 735cba5bed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -249,8 +249,8 @@ module ActiveRecord
# go through Active Record's type casting and serialization.
#
# See #upsert_all for documentation.
def upsert(attributes, on_duplicate: :update, returning: nil, unique_by: nil, record_timestamps: nil)
upsert_all([ attributes ], on_duplicate: on_duplicate, returning: returning, unique_by: unique_by, record_timestamps: record_timestamps)
def upsert(attributes, **kwargs)
upsert_all([ attributes ], **kwargs)
end
# Updates or inserts (upserts) multiple records into the database in a