method

lookup_cast_type_from_column

Importance_2
v7.0.0 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::Quoting
lookup_cast_type_from_column(column) public

If you are having to call this function, you are likely doing something wrong. The column does not have sufficient type information if the user provided a custom type on the class level either explicitly (via Attributes::ClassMethods#attribute) or implicitly (via AttributeMethods::Serialization::ClassMethods#serialize, time_zone_aware_attributes). In almost all cases, the sql type should only be used to change quoting behavior, when the primitive to represent the type doesn’t sufficiently reflect the differences (varchar vs binary) for example. The type used to get this primitive should have been provided before reaching the connection adapter.

Show source
Register or log in to add new notes.