Skip to content

Commit

Permalink
Use with_connection instead of lease_connection in TypeCaster::Connec…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
andrewn617 committed Mar 26, 2024
1 parent 640e398 commit 42fede5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/type_caster/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def type_for_attribute(attr_name)
if schema_cache.data_source_exists?(table_name)
column = schema_cache.columns_hash(table_name)[attr_name.to_s]
if column
type = @klass.lease_connection.lookup_cast_type_from_column(column)
type = @klass.with_connection { |connection| connection.lookup_cast_type_from_column(column) }
end
end

Expand Down

0 comments on commit 42fede5

Please sign in to comment.