Skip to content

Commit 9cd422e

Browse files
committed
Replace 'type_cast_from_column' to support Rails 6.1
1 parent acf46d5 commit 9cd422e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/bulk_insert/worker.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,10 @@ def compose_insert_query
109109
value = @now if value == :__timestamp_placeholder
110110

111111
if ActiveRecord::VERSION::STRING >= "5.0.0"
112-
value = @connection.type_cast_from_column(column, value) if column
112+
if column
113+
type = @connection.lookup_cast_type_from_column(column)
114+
value = type.serialize(value)
115+
end
113116
values << @connection.quote(value)
114117
else
115118
values << @connection.quote(value, column)

0 commit comments

Comments
 (0)