Skip to content

Commit 735cba5

Browse files
authored
Merge pull request rails#49063 from gregmolnar/upsert
2 parents a2a520e + c775fa4 commit 735cba5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/lib/active_record/persistence.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ def insert_all!(attributes, returning: nil, record_timestamps: nil)
249249
# go through Active Record's type casting and serialization.
250250
#
251251
# See #upsert_all for documentation.
252-
def upsert(attributes, on_duplicate: :update, returning: nil, unique_by: nil, record_timestamps: nil)
253-
upsert_all([ attributes ], on_duplicate: on_duplicate, returning: returning, unique_by: unique_by, record_timestamps: record_timestamps)
252+
def upsert(attributes, **kwargs)
253+
upsert_all([ attributes ], **kwargs)
254254
end
255255

256256
# Updates or inserts (upserts) multiple records into the database in a

0 commit comments

Comments
 (0)