Skip to content

Commit 25d2a63

Browse files
committed
Use ActiveModel::Type::SerializeCastValue to casted value in InsertAll
See rails#44625 for more details.
1 parent df99121 commit 25d2a63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/insert_all.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def values_list
240240

241241
values_list = insert_all.map_key_with_value do |key, value|
242242
next value if Arel::Nodes::SqlLiteral === value
243-
types[key].serialize(types[key].cast(value))
243+
ActiveModel::Type::SerializeCastValue.serialize(type = types[key], type.cast(value))
244244
end
245245

246246
connection.visitor.compile(Arel::Nodes::ValuesList.new(values_list))

0 commit comments

Comments
 (0)