@@ -63,8 +63,8 @@ def create!(attributes = nil, &block)
63
63
# go through Active Record's type casting and serialization.
64
64
#
65
65
# See <tt>ActiveRecord::Persistence#insert_all</tt> for documentation.
66
- def insert ( attributes , returning : nil , unique_by : nil )
67
- insert_all ( [ attributes ] , returning : returning , unique_by : unique_by )
66
+ def insert ( attributes , returning : nil , unique_by : nil , record_timestamps : nil )
67
+ insert_all ( [ attributes ] , returning : returning , unique_by : unique_by , record_timestamps : record_timestamps )
68
68
end
69
69
70
70
# Inserts multiple records into the database in a single SQL INSERT
@@ -131,8 +131,8 @@ def insert(attributes, returning: nil, unique_by: nil)
131
131
# { id: 1, title: "Rework" },
132
132
# { id: 2, title: "Eloquent Ruby" }
133
133
# ])
134
- def insert_all ( attributes , returning : nil , unique_by : nil )
135
- InsertAll . new ( self , attributes , on_duplicate : :skip , returning : returning , unique_by : unique_by ) . execute
134
+ def insert_all ( attributes , returning : nil , unique_by : nil , record_timestamps : nil )
135
+ InsertAll . new ( self , attributes , on_duplicate : :skip , returning : returning , unique_by : unique_by , record_timestamps : record_timestamps ) . execute
136
136
end
137
137
138
138
# Inserts a single record into the database in a single SQL INSERT
@@ -141,8 +141,8 @@ def insert_all(attributes, returning: nil, unique_by: nil)
141
141
# go through Active Record's type casting and serialization.
142
142
#
143
143
# See <tt>ActiveRecord::Persistence#insert_all!</tt> for more.
144
- def insert! ( attributes , returning : nil )
145
- insert_all! ( [ attributes ] , returning : returning )
144
+ def insert! ( attributes , returning : nil , record_timestamps : nil )
145
+ insert_all! ( [ attributes ] , returning : returning , record_timestamps : record_timestamps )
146
146
end
147
147
148
148
# Inserts multiple records into the database in a single SQL INSERT
@@ -188,8 +188,8 @@ def insert!(attributes, returning: nil)
188
188
# { id: 1, title: "Rework", author: "David" },
189
189
# { id: 1, title: "Eloquent Ruby", author: "Russ" }
190
190
# ])
191
- def insert_all! ( attributes , returning : nil )
192
- InsertAll . new ( self , attributes , on_duplicate : :raise , returning : returning ) . execute
191
+ def insert_all! ( attributes , returning : nil , record_timestamps : nil )
192
+ InsertAll . new ( self , attributes , on_duplicate : :raise , returning : returning , record_timestamps : record_timestamps ) . execute
193
193
end
194
194
195
195
# Updates or inserts (upserts) a single record into the database in a
@@ -198,8 +198,8 @@ def insert_all!(attributes, returning: nil)
198
198
# go through Active Record's type casting and serialization.
199
199
#
200
200
# See <tt>ActiveRecord::Persistence#upsert_all</tt> for documentation.
201
- def upsert ( attributes , on_duplicate : :update , returning : nil , unique_by : nil )
202
- upsert_all ( [ attributes ] , on_duplicate : on_duplicate , returning : returning , unique_by : unique_by )
201
+ def upsert ( attributes , on_duplicate : :update , returning : nil , unique_by : nil , record_timestamps : nil )
202
+ upsert_all ( [ attributes ] , on_duplicate : on_duplicate , returning : returning , unique_by : unique_by , record_timestamps : record_timestamps )
203
203
end
204
204
205
205
# Updates or inserts (upserts) multiple records into the database in a
@@ -261,8 +261,8 @@ def upsert(attributes, on_duplicate: :update, returning: nil, unique_by: nil)
261
261
# ], unique_by: :isbn)
262
262
#
263
263
# Book.find_by(isbn: "1").title # => "Eloquent Ruby"
264
- def upsert_all ( attributes , on_duplicate : :update , returning : nil , unique_by : nil )
265
- InsertAll . new ( self , attributes , on_duplicate : on_duplicate , returning : returning , unique_by : unique_by ) . execute
264
+ def upsert_all ( attributes , on_duplicate : :update , returning : nil , unique_by : nil , record_timestamps : nil )
265
+ InsertAll . new ( self , attributes , on_duplicate : on_duplicate , returning : returning , unique_by : unique_by , record_timestamps : record_timestamps ) . execute
266
266
end
267
267
268
268
# Given an attributes hash, +instantiate+ returns a new instance of
0 commit comments