Flowdock
method

type_for_attribute

Importance_1
v6.0.0 - Show latest stable - 0 notes - Class: ClassMethods
type_for_attribute(attr_name, &block) public

Returns the type of the attribute with the given name, after applying all modifiers. This method is the only valid source of information for anything related to the types of a model’s attributes. This method will access the database and load the model’s schema if it is required.

The return value of this method will implement the interface described by ActiveModel::Type::Value (though the object itself may not subclass it).

attr_name The name of the attribute to retrieve the type for. Must be a string or a symbol.

Show source
Register or log in to add new notes.