Flowdock
method

decorate_matching_attribute_types

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

This method is an internal API used to create higher level features like time zone aware attributes.

When the schema for a model is loaded, matcher will be called for each attribute with its name and type. If the matcher returns a truthy value, the type will then be yielded to the given block, and the return value of that block will replace the type.

Subsequent calls to this method with the same value for decorator_name will replace the previous decorator, not decorate twice. This can be used to ensure that class macros are idempotent.

Show source
Register or log in to add new notes.