Skip to content

Commit 462d7c7

Browse files
authored
Merge pull request rails#53511 from kamipo/use_serialize_cast_value_in_insert_all
Use `ActiveModel::Type::SerializeCastValue` to casted value in `InsertAll`
2 parents 721a392 + 25d2a63 commit 462d7c7

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)