class ActiveRecord::TypeCaster::Connection

def type_for_attribute(attr_name)

Experimental RBS support (using type sampling data from the type_fusion project).

def type_for_attribute: (String attr_name) -> ActiveModel::Type::Value

This signature was generated using 1 sample from 1 application.

def type_for_attribute(attr_name)
  schema_cache = connection.schema_cache
  if schema_cache.data_source_exists?(table_name)
    column = schema_cache.columns_hash(table_name)[attr_name.to_s]
    type = connection.lookup_cast_type_from_column(column) if column
  end
  type || Type.default_value
end