@@ -173,7 +173,7 @@ def insert(attributes, returning: nil, unique_by: nil, record_timestamps: nil)
173
173
# { id: 2, title: "Eloquent Ruby" }
174
174
# ])
175
175
def insert_all ( attributes , returning : nil , unique_by : nil , record_timestamps : nil )
176
- InsertAll . new ( self , attributes , on_duplicate : :skip , returning : returning , unique_by : unique_by , record_timestamps : record_timestamps ) . execute
176
+ InsertAll . execute ( self , attributes , on_duplicate : :skip , returning : returning , unique_by : unique_by , record_timestamps : record_timestamps )
177
177
end
178
178
179
179
# Inserts a single record into the database in a single SQL INSERT
@@ -240,7 +240,7 @@ def insert!(attributes, returning: nil, record_timestamps: nil)
240
240
# { id: 1, title: "Eloquent Ruby", author: "Russ" }
241
241
# ])
242
242
def insert_all! ( attributes , returning : nil , record_timestamps : nil )
243
- InsertAll . new ( self , attributes , on_duplicate : :raise , returning : returning , record_timestamps : record_timestamps ) . execute
243
+ InsertAll . execute ( self , attributes , on_duplicate : :raise , returning : returning , record_timestamps : record_timestamps )
244
244
end
245
245
246
246
# Updates or inserts (upserts) a single record into the database in a
@@ -360,7 +360,7 @@ def upsert(attributes, **kwargs)
360
360
#
361
361
# Book.find_by(isbn: "1").title # => "Eloquent Ruby"
362
362
def upsert_all ( attributes , on_duplicate : :update , update_only : nil , returning : nil , unique_by : nil , record_timestamps : nil )
363
- InsertAll . new ( self , attributes , on_duplicate : on_duplicate , update_only : update_only , returning : returning , unique_by : unique_by , record_timestamps : record_timestamps ) . execute
363
+ InsertAll . execute ( self , attributes , on_duplicate : on_duplicate , update_only : update_only , returning : returning , unique_by : unique_by , record_timestamps : record_timestamps )
364
364
end
365
365
366
366
# Given an attributes hash, +instantiate+ returns a new instance of
0 commit comments