Flowdock
method

decorate_attribute_type

Importance_1
v5.2.3 - Show latest stable - 0 notes - Class: ClassMethods
decorate_attribute_type(column_name, decorator_name, &block) public

This method is an internal API used to create class macros such as serialize, and features like time zone aware attributes.

Used to wrap the type of an attribute in a new type. When the schema for a model is loaded, attributes with the same name as column_name will have their type yielded to the given block. The return value of that block will be used instead.

Subsequent calls where column_name and decorator_name are the same will override the previous decorator, not decorate twice. This can be used to create idempotent class macros like serialize

Show source
Register or log in to add new notes.