Flowdock
method

type_for_attribute

Importance_0
v6.0.0 - Show latest stable - 0 notes - Class: Connection
type_for_attribute(attr_name) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/type_caster/connection.rb, line 17
      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
Register or log in to add new notes.