Skip to content

Commit 42fede5

Browse files
committed
Use with_connection instead of lease_connection in TypeCaster::Connection
1 parent 640e398 commit 42fede5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activerecord/lib/active_record/type_caster/connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def type_for_attribute(attr_name)
1919
if schema_cache.data_source_exists?(table_name)
2020
column = schema_cache.columns_hash(table_name)[attr_name.to_s]
2121
if column
22-
type = @klass.lease_connection.lookup_cast_type_from_column(column)
22+
type = @klass.with_connection { |connection| connection.lookup_cast_type_from_column(column) }
2323
end
2424
end
2525

0 commit comments

Comments
 (0)